@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();
  }
  @After
  public void cleanupForAll() throws Exception {
    if (controller.isStarted()) {
      controller.stop();
    }

    // clean up created temporary files and directories
    if (DO_CLEANUP) {
      if (IoUtils.recursiveDelete(tempDir)) {
        tempDir.deleteOnExit();
      }
    }

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