@Test
public void testUpdateConfigForceSecurityEnabled() throws Exception {

  Map<String, String> commandParams = new HashMap<String, String>();
  commandParams.put(KerberosServerAction.DATA_DIRECTORY, dataDir);
  ExecutionCommand executionCommand = new ExecutionCommand();
  executionCommand.setCommandParams(commandParams);
  ConfigHelper configHelper = injector.getInstance(ConfigHelper.class);
  Capture<String> configTypes = Capture.newInstance(CaptureType.ALL);
  Capture<Map<String, String>> configUpdates = Capture.newInstance(CaptureType.ALL);
  configHelper.updateConfigType(anyObject(Cluster.class), anyObject(AmbariManagementController.class),
      capture(configTypes), capture(configUpdates), anyObject(Collection.class), anyObject(String.class), anyObject(String.class));
  expectLastCall().atLeastOnce();
  replayAll();
  action.setExecutionCommand(executionCommand);
  action.execute(null);
  assertTrue(configTypes.getValues().contains("cluster-env"));
  boolean containsSecurityEnabled = false;
  for(Map<String, String> properties: configUpdates.getValues()) {
    if(properties.containsKey("security_enabled")) {
      containsSecurityEnabled = true;
      break;
    }
  }
  assertTrue(containsSecurityEnabled);
  verifyAll();
}