### Question:
Generator { public void project(GenModel genModel, Path targetFolder) { if (existsAndNotEmpty(targetFolder)) { throw new NgoyException("Target folder must be empty: %s", targetFolder); } String[] all = { ".gitignore.tpl", "build.gradle.tpl", "ngoy.cmd.tpl", "ngoy.tpl", "settings.gradle.tpl", "src/main/java/$pack/$nameWebApplication.java.tpl", "src/main/java/$pack/app/app.component.css.tpl", "src/main/java/$pack/app/app.component.html.tpl", "src/main/java/$pack/app/AppComponent.java.tpl", "src/main/java/$pack/app/Main.java.tpl", "src/main/resources/application.properties.tpl", "src/main/resources/messages_en.properties.tpl", }; generateArtifacts(genModel, "", targetFolder, "project", all); initGit(targetFolder); }  void directive(GenModel genModel, Path targetFolder); void mod(GenModel genModel, Path targetFolder); void pipe(GenModel genModel, Path targetFolder); void component(GenModel genModel, Path targetFolder); void service(GenModel genModel, Path targetFolder); void project(GenModel genModel, Path targetFolder); Consumer<String> getLog(); void setLog(Consumer<String> log);  }### Answer:
@Test public void testProjectNotEmptyFolder() throws Exception { GenModel genModel = new GenModel("app", "org.qbert.ClockWise", TEST_VERSION); Path fldr = folder.newFolder() .toPath(); Files.write(fldr.resolve("dummy"), "".getBytes()); expectedEx.expect(NgoyException.class); expectedEx.expectMessage(containsString("Target folder must be empty")); expectedEx.expectMessage(containsString(fldr.toString())); generator.project(genModel, fldr); }
@Test public void testProject() throws Exception { GenModel genModel = new GenModel("app", "org.qbert.ClockWise", TEST_VERSION); Path fldr = folder.newFolder() .toPath(); generator.project(genModel, fldr); assertThat(fldr.toFile() .listFiles()).hasSize(6); assertThat(fldr.resolve("src/main/java/org/qbert") .toFile() .listFiles()).hasSize(2); assertThat(fldr.resolve("src/main/resources") .toFile() .listFiles()).hasSize(2); assertThat(fldr.resolve("src/main/java/org/qbert/app") .toFile() .listFiles()).hasSize(4); }