@Test
public void testExecuteDockerStop() throws Exception {

  DockerStopCommand dockerCommand = new DockerStopCommand(MOCK_CONTAINER_ID);
  DockerCommandExecutor.executeDockerCommand(dockerCommand, MOCK_CONTAINER_ID,
      env, mockExecutor, false, nmContext);
  List<PrivilegedOperation> ops = MockPrivilegedOperationCaptor
      .capturePrivilegedOperations(mockExecutor, 1, true);
  List<String> dockerCommands = getValidatedDockerCommands(ops);
  assertEquals(1, ops.size());
  assertEquals(PrivilegedOperation.OperationType.RUN_DOCKER_CMD.name(),
      ops.get(0).getOperationType().name());
  assertEquals(3, dockerCommands.size());
  assertEquals("[docker-command-execution]", dockerCommands.get(0));
  assertEquals("  docker-command=stop", dockerCommands.get(1));
  assertEquals("  name=" + MOCK_CONTAINER_ID, dockerCommands.get(2));
}