keycloak-aplcache

Merge pull request #4588 from tkyjovsk/KEYCLOAK-5711 KEYCLOAK-5711

10/23/2017 6:27:31 PM

Details

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();
-            }
         }
     }