From bd706418c9862b37dc49701397e7ecfe47c2801a Mon Sep 17 00:00:00 2001 From: Tomas Kyjovsky Date: Thu, 19 Oct 2017 14:20:44 +0200 Subject: [PATCH] KEYCLOAK-5711 Adapter test module for Wildfly has compilation error --- .../example/hal/WildflyConsoleProtectionTest.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 ce2ab8d42c..37e3bd3d92 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(); - } } }