@BeforeClass
  public static void prepareServer() throws Exception {
    containerController.startInAdminMode();
    ManagementClient mgmtClient = containerController.getClient();
    // final ModelControllerClient client = mgmtClient.getControllerClient();
    keystoreFilesSetup.setup(mgmtClient);
    managementNativeRealmSetup.setup(mgmtClient);

    picketLinkModule = PicketBoxModuleUtil.createTestModule();
    // To apply new security realm settings for http interface reload of  server is required
    reloadServer();
  }
  @AfterClass
  public static void resetTestConfiguration() throws Exception {
    ModelControllerClient client =
        HTTPSManagementInterfaceTestCase.getNativeModelControllerClient();
    ManagementClient managementClient =
        new ManagementClient(
            client, TestSuiteEnvironment.getServerAddress(), MANAGEMENT_NATIVE_PORT, "remoting");

    HTTPSManagementInterfaceTestCase.resetHttpInterfaceConfiguration(client);

    // reload to apply changes
    reloadServer(); // reload using CLI

    keystoreFilesSetup.tearDown(managementClient);
    managementNativeRealmSetup.tearDown(managementClient);

    containerController.stop();
    picketLinkModule.remove();
    FileUtils.deleteDirectory(WORK_DIR);
  }
  @Test
  @InSequence(4)
  public void resetTestConfiguration() throws Exception {

    LOGGER.info("*** reseting test configuration");
    ModelControllerClient client = getNativeModelControllerClient();
    ManagementClient managementClient =
        new ManagementClient(
            client, TestSuiteEnvironment.getServerAddress(), MANAGEMENT_NATIVE_PORT, "remoting");

    resetHttpInterfaceConfiguration(client);

    // reload to apply changes
    CustomCLIExecutor.execute(null, RELOAD, NATIVE_CONTROLLER);
    CustomCLIExecutor.waitForServerToReload(MAX_RELOAD_TIME, NATIVE_CONTROLLER);

    keystoreFilesSetup.tearDown(managementClient, CONTAINER);
    managementNativeRealmSetup.tearDown(managementClient, CONTAINER);

    LOGGER.info("*** stopping container");
    containerController.stop(CONTAINER);
  }
  @Test
  @InSequence(-1)
  public void prepareServer() throws Exception {

    LOGGER.info("*** starting server");
    containerController.start(CONTAINER);
    final ModelControllerClient client = TestSuiteEnvironment.getModelControllerClient();
    ManagementClient mgmtClient =
        new ManagementClient(
            client,
            TestSuiteEnvironment.getServerAddress(),
            TestSuiteEnvironment.getServerPort(),
            "http-remoting");
    keystoreFilesSetup.setup(mgmtClient, CONTAINER);
    managementNativeRealmSetup.setup(mgmtClient, CONTAINER);

    mgmtClient.close();
    // To apply new security realm settings for http interface reload of
    // server is required
    LOGGER.info("*** restart server");
    CustomCLIExecutor.execute(null, RELOAD, NATIVE_CONTROLLER);
    CustomCLIExecutor.waitForServerToReload(MAX_RELOAD_TIME, NATIVE_CONTROLLER);
  }