DockerInspectCommand extends DockerCommand { public DockerInspectCommand getContainerStatus() { super.addCommandArguments("format", STATUS_TEMPLATE); this.commandArguments = String.format("--format=%s", STATUS_TEMPLATE); return this; } DockerInspectCommand(String containerName); DockerInspectCommand getContainerStatus(); DockerInspectCommand getIpAndHost(); DockerInspectCommand get(String[] templates, char delimiter); @Override PrivilegedOperation preparePrivilegedOperation(
      DockerCommand dockerCommand, String containerName, Map<String,
      String> env, Context nmContext); static final String STATUS_TEMPLATE; static final String STOPSIGNAL_TEMPLATE; }
@Test public void testGetContainerStatus() throws Exception { dockerInspectCommand.getContainerStatus(); assertEquals("inspect", StringUtils.join(",", dockerInspectCommand.getDockerCommandWithArguments() .get("docker-command"))); assertEquals("{{.State.Status}}", StringUtils.join(",", dockerInspectCommand.getDockerCommandWithArguments().get("format"))); assertEquals("foo", StringUtils.join(",", dockerInspectCommand.getDockerCommandWithArguments().get("name"))); assertEquals(3, dockerInspectCommand.getDockerCommandWithArguments().size()); }