PomAddDependency extends AbstractArtifactPomOperation<PomAddDependency> implements AddElement<PomAddDependency> { @Override public PomAddDependency warnButAddIfPresent() { ifPresent = IfPresent.WarnButAdd; return this; } PomAddDependency();  PomAddDependency(String groupId, String artifactId);  PomAddDependency(String groupId, String artifactId, String version);  PomAddDependency(String groupId, String artifactId, String version, String scope); PomAddDependency setVersion(String version); PomAddDependency setScope(String scope); @Override PomAddDependency failIfPresent(); @Override PomAddDependency warnNotAddIfPresent(); @Override PomAddDependency warnButAddIfPresent(); @Override PomAddDependency noOpIfPresent(); @Override PomAddDependency overwriteIfPresent(); String getVersion(); String getScope(); @Override String getDescription();  }
@Test public void warnButAddIfPresentTest() throws IOException, XmlPullParserException { PomAddDependency uut = new PomAddDependency("xmlunit", "xmlunit", "1.7").relative("pom.xml").warnButAddIfPresent(); TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.WARNING); Assert.assertNull(executionResult.getException()); Dependency dependencyAfterChange = getDependencyInList(getTransformedPomModel("pom.xml"), "xmlunit", "xmlunit", "1.7"); Assert.assertNotNull(dependencyAfterChange); }