PomAddModule extends AbstractPomOperation<PomAddModule> implements AddElement<PomAddModule> { @Override public PomAddModule warnNotAddIfPresent() { ifPresent = IfPresent.WarnNotAdd; return this; } PomAddModule();  PomAddModule(String moduleName); @Override PomAddModule failIfPresent(); @Override PomAddModule warnNotAddIfPresent(); @Override PomAddModule warnButAddIfPresent(); @Override PomAddModule noOpIfPresent(); @Override PomAddModule overwriteIfPresent(); PomAddModule setModuleName(String moduleName); String getModuleName(); @Override String getDescription(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void moduleAlreadyPresentNotAddWarnTest() throws IOException, SAXException, ParserConfigurationException { PomAddModule pomAddModule = new PomAddModule("module1").relative("pom.xml").warnNotAddIfPresent(); TOExecutionResult executionResult = pomAddModule.execution(transformedAppFolder, transformationContext); assertEqualsXml("pom.xml"); assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); assertNull(executionResult.getException()); assertNotNull(executionResult.getWarnings()); assertEquals(executionResult.getWarnings().size(), 1); assertEquals(executionResult.getWarnings().get(0).getClass(), TransformationOperationException.class); assertEquals(executionResult.getWarnings().get(0).getMessage(), "Module module1 was not added to POM file pom.xml because it is already present"); }