diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-25 17:00:27 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-06-25 17:00:27 +0200 |
commit | bc758439307497a00be5a62ddbe0e64a2ca135ff (patch) | |
tree | 357ddc0f583db9aa48fe8c72c370332024cd3489 /bundle-plugin | |
parent | 9ef4dd059567e7ba2108e50fd0c851178982006c (diff) |
Remove Mockito usage
Diffstat (limited to 'bundle-plugin')
-rw-r--r-- | bundle-plugin/pom.xml | 5 | ||||
-rw-r--r-- | bundle-plugin/src/test/java/com/yahoo/container/plugin/mojo/TestProvidedArtifactsTest.java | 10 |
2 files changed, 4 insertions, 11 deletions
diff --git a/bundle-plugin/pom.xml b/bundle-plugin/pom.xml index 4187071c1e1..611753528c3 100644 --- a/bundle-plugin/pom.xml +++ b/bundle-plugin/pom.xml @@ -39,11 +39,6 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-library</artifactId> <scope>test</scope> diff --git a/bundle-plugin/src/test/java/com/yahoo/container/plugin/mojo/TestProvidedArtifactsTest.java b/bundle-plugin/src/test/java/com/yahoo/container/plugin/mojo/TestProvidedArtifactsTest.java index 0c0bdffed6e..b60bce794f5 100644 --- a/bundle-plugin/src/test/java/com/yahoo/container/plugin/mojo/TestProvidedArtifactsTest.java +++ b/bundle-plugin/src/test/java/com/yahoo/container/plugin/mojo/TestProvidedArtifactsTest.java @@ -3,8 +3,9 @@ package com.yahoo.container.plugin.mojo; import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.junit.Test; -import org.mockito.Mockito; import java.util.ArrayList; import java.util.Arrays; @@ -14,7 +15,6 @@ import java.util.TreeMap; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.when; /** * @author bjorncs @@ -53,14 +53,12 @@ public class TestProvidedArtifactsTest { } private static Artifact createArtifact(String artifactId, String... dependents) { - Artifact artifact = Mockito.mock(Artifact.class); - when(artifact.getArtifactId()).thenReturn(artifactId); - when(artifact.getGroupId()).thenReturn(GROUP_ID); + Artifact artifact = new DefaultArtifact(GROUP_ID, artifactId, "1.0", "test", "jar", "deploy", new DefaultArtifactHandler("jar")); List<String> dependencyTrail = new ArrayList<>(); dependencyTrail.add(fullId("bundle-plugin")); Arrays.stream(dependents).forEach(dependent -> dependencyTrail.add(fullId(dependent))); dependencyTrail.add(fullId(artifactId)); - when(artifact.getDependencyTrail()).thenReturn(dependencyTrail); + artifact.setDependencyTrail(dependencyTrail); return artifact; } |