@Test
public void moduleAlreadyPresentOverwriteWarnTest() throws IOException, SAXException, ParserConfigurationException, XmlPullParserException {

    PomAddModule pomAddModule = new PomAddModule("module1").relative("pom.xml").warnButAddIfPresent();
    TOExecutionResult executionResult = pomAddModule.execution(transformedAppFolder, transformationContext);
    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 already present in POM file pom.xml");
    Model pomModelAfterChange = getTransformedPomModel("pom.xml");
    assertEquals(pomModelAfterChange.getModules().size(), 1);
    assertTrue(pomModelAfterChange.getModules().contains("module1"));
IXME
ncomment this when STAX based version of this TO is implemented
      assertNotChangedFile("pom.xml");
}