@Test
public void testEnabledSandboxWithWhitelist()
    throws ContainerExecutionException{

  String[] inputCommand = {
      "$JAVA_HOME/bin/java jar -Djava.security.manager MyJob.jar"
  };
  List<String> commands = Arrays.asList(inputCommand);
  conf.set(YarnConfiguration.YARN_CONTAINER_SANDBOX_WHITELIST_GROUP,
      WHITELIST_GROUP);
  runtimeContextBuilder.setExecutionAttribute(USER, WHITELIST_USER);
  runtimeContextBuilder.setExecutionAttribute(CONTAINER_RUN_CMDS, commands);
  runtime.prepareContainer(runtimeContextBuilder.build());
  Assert.assertTrue("Command should be modified to include " +
          "policy file in whitelisted Sandbox mode",
      commands.get(0).contains(SECURITY_FLAG)
      && commands.get(0).contains(POLICY_FLAG));
}