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