### Question:
MultiPomGenerator { public void generate() throws GeneratorException { Configuration freeMarkerConfiguration = new Configuration(); freeMarkerConfiguration.setClassForTemplateLoading(MultiPomGenerator.class, "/templates/pom"); freeMarkerConfiguration.setDefaultEncoding("UTF-8"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< start generating pom"); this.generateProjectPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating pom successfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom"); this.generateProjectClientPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating client pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom"); this.generateProjectSharedPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating shared pom sucessfully finished"); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom"); this.generateProjectServerPom(freeMarkerConfiguration); logger.debug(">>" + naluGeneraterParms.getArtefactId() + "<< generating server pom sucessfully finished"); } private  MultiPomGenerator(Builder builder); static Builder builder(); void generate();  }### Answer:
@Test public void springBootServerPom() throws GeneratorException, IOException { MultiPomGenerator generator = getGeneratorForSpringBoot(); generator.generate(); File serverPom = Arrays.stream(Objects.requireNonNull(serverFolder.getRoot().listFiles())) .filter(f -> f.getName().equals("pom.xml")).findFirst().orElse(null); assertNotNull(serverPom); String pomAsString = FileUtils.readFileToString(serverPom); assertTrue(pomAsString.contains("${spring-boot.version}")); assertTrue(pomAsString.contains("<spring-boot.version>2.2.2.RELEASE</spring-boot.version>")); assertTrue(pomAsString.contains("<artifactId>spring-boot-starter-web</artifactId>")); assertTrue(pomAsString.contains("<artifactId>spring-boot-maven-plugin</artifactId>")); assertFalse(pomAsString.contains("<artifactId>jetty-maven-plugin</artifactId>")); assertFalse(pomAsString.contains("<artifactId>tomcat7-maven-plugin</artifactId>")); }
@Test public void springBootClientPom() throws GeneratorException, IOException { MultiPomGenerator generator = getGeneratorForSpringBoot(); generator.generate(); File clientPom = Arrays.stream(Objects.requireNonNull(clientFolder.getRoot().listFiles())) .filter(f -> f.getName().equals("pom.xml")).findFirst().orElse(null); assertNotNull(clientPom); String pomAsString = FileUtils.readFileToString(clientPom); assertTrue(pomAsString.contains("<spring-boot.public.dir>")); assertTrue(pomAsString.contains("<launcherDir>${spring-boot.public.dir}</launcherDir>")); assertTrue(pomAsString.contains("<warDir>${spring-boot.public.dir}</warDir>")); }
@Test public void springBootParentPom() throws GeneratorException, IOException { MultiPomGenerator generator = getGeneratorForSpringBoot(); generator.generate(); File parentPom = Arrays.stream(Objects.requireNonNull(projectFolder.getRoot().listFiles())) .filter(f -> f.getName().equals("pom.xml")).findFirst().orElse(null); assertNotNull(parentPom); String pomAsString = FileUtils.readFileToString(parentPom); assertFalse(pomAsString.contains("<launcherDir>${projectBuildDirectory}/gwt/launcherDir</launcherDir>")); }