@Test
public void failNotPresentTest() throws IOException {

    PomReplaceDependency pomReplaceDependency = new PomReplaceDependency("foo", "bar", "newfoo", "newbar").relative("pom.xml").failIfNotPresent();
    TOExecutionResult executionResult = pomReplaceDependency.execution(transformedAppFolder, transformationContext);
    assertEquals(executionResult.getType(), TOExecutionResult.Type.ERROR);
    assertEquals(executionResult.getException().getClass(), TransformationOperationException.class);
    assertEquals(executionResult.getException().getMessage(), "Dependency foo:bar has not been replaced by newfoo:newbar in POM file /pom.xml because it is not present");
    assertNull(executionResult.getException().getCause());
    assertNotChangedFile("pom.xml");
}