diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java
index ce2ab8d..37e3bd3 100644
--- a/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java
+++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/wildfly/src/test/java/org/keycloak/testsuite/adapter/example/hal/WildflyConsoleProtectionTest.java
@@ -59,13 +59,9 @@ public class WildflyConsoleProtectionTest extends AbstractAdapterTest {
}
@Before
- public void beforeAuthTest() throws IOException, OperationException {
- super.beforeAuthTest();
+ public void beforeConsoleProtectionTest() throws IOException, OperationException {
- OnlineManagementClient clientWorkerNodeClient = null;
-
- try {
- clientWorkerNodeClient = AppServerTestEnricher.getManagementClient();
+ try (OnlineManagementClient clientWorkerNodeClient = AppServerTestEnricher.getManagementClient()) {
Operations operations = new Operations(clientWorkerNodeClient);
@@ -94,10 +90,6 @@ public class WildflyConsoleProtectionTest extends AbstractAdapterTest {
clientWorkerNodeClient.execute("reload");
} catch (CliException cause) {
throw new RuntimeException("Failed to configure app server", cause);
- } finally {
- if (clientWorkerNodeClient != null) {
- clientWorkerNodeClient.close();
- }
}
}