@Test public void overwriteIfPresentTest() throws IOException, XmlPullParserException { PomAddManagedDependency uut = new PomAddManagedDependency("junit", "junit", "4.11").relative("pom.xml").overwriteIfPresent().setScope("test"); TOExecutionResult executionResult = uut.execution(transformedAppFolder, transformationContext); Assert.assertEquals(executionResult.getType(), TOExecutionResult.Type.SUCCESS); Assert.assertNull(executionResult.getException()); Dependency dependencyAfterChange = getManagedDependencyInList(getTransformedPomModel("pom.xml"), "junit", "junit", "4.11"); Assert.assertNotNull(dependencyAfterChange); Assert.assertEquals(dependencyAfterChange.getScope(), "test"); }
@Override public PomAddManagedDependency overwriteIfPresent() { ifPresent = IfPresent.Overwrite; return this; }
PomAddManagedDependency extends AbstractArtifactPomOperation<PomAddManagedDependency> implements AddElement<PomAddManagedDependency> { @Override public PomAddManagedDependency overwriteIfPresent() { ifPresent = IfPresent.Overwrite; return this; } }
PomAddManagedDependency extends AbstractArtifactPomOperation<PomAddManagedDependency> implements AddElement<PomAddManagedDependency> { @Override public PomAddManagedDependency overwriteIfPresent() { ifPresent = IfPresent.Overwrite; return this; } PomAddManagedDependency();  PomAddManagedDependency(String groupId, String artifactId, String version);  PomAddManagedDependency(String groupId, String artifactId, String version, String scope); }
PomAddManagedDependency extends AbstractArtifactPomOperation<PomAddManagedDependency> implements AddElement<PomAddManagedDependency> { @Override public PomAddManagedDependency overwriteIfPresent() { ifPresent = IfPresent.Overwrite; 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(); }
PomAddManagedDependency extends AbstractArtifactPomOperation<PomAddManagedDependency> implements AddElement<PomAddManagedDependency> { @Override public PomAddManagedDependency overwriteIfPresent() { ifPresent = IfPresent.Overwrite; 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();  }