### Question:
DockerfileCommand extends DefaultCommand { @Override public void run() throws CLIException { File dockerfile = new File(getCwd(), "Dockerfile"); if (dockerfile.exists()) { fatal("Dockerfile already exists."); } try (InputStream in = DockerfileCommand.class.getClassLoader().getResourceAsStream("META-INF/es4x-commands/Dockerfile")) { if (in == null) { fatal("Cannot load Dockerfile template."); } else { Files.copy(in, dockerfile.toPath()); } } catch (IOException e) { fatal(e.getMessage()); } File dockerignore = new File(getCwd(), ".dockerignore"); if (!dockerignore.exists()) { try (InputStream in = DockerfileCommand.class.getClassLoader().getResourceAsStream("META-INF/es4x-commands/.dockerignore")) { if (in == null) { fatal("Cannot load .dockerignore template."); } else { Files.copy(in, dockerignore.toPath()); } } catch (IOException e) { fatal(e.getMessage()); } } }  @Override void run();  }### Answer:
@Test public void shouldCreateADockerFile() { command.setCwd(IOUtils.mkTempDir()); File file = new File(command.getCwd(), "Dockerfile"); file.deleteOnExit(); assertFalse(file.exists()); command.run(); assertTrue(file.exists()); }