Repository: mojohaus/versions
Pull request #1094 (2024-06-21 20:18:56)

Use JUnit5 in versions-commons, versions-enforcer


Patch:
diff --git a/pom.xml b/pom.xml
index d2f9c04b..c8827274 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,6 +130,9 @@
     <modelloNamespaceRuleVersion>2.1.0</modelloNamespaceRuleVersion>
     <modelloNamespaceReportVersion>2.0.0</modelloNamespaceReportVersion>
     <byteBuddyVersion>1.14.17</byteBuddyVersion>
+    <!-- use the same version as in Maven core -->
+    <mavenResolverVersion>1.4.1</mavenResolverVersion>
+
     <scmpublish.content>${project.build.directory}/staging/versions</scmpublish.content>
     <!-- execute ITS in parallel by default -->
     <invoker.parallelThreads>0.75C</invoker.parallelThreads>
@@ -185,14 +188,13 @@
       <dependency>
         <groupId>org.apache.maven.resolver</groupId>
         <artifactId>maven-resolver-api</artifactId>
-        <!-- use the same version as in Maven core -->
-        <version>1.4.1</version>
+        <version>${mavenResolverVersion}</version>
         <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven.resolver</groupId>
         <artifactId>maven-resolver-util</artifactId>
-        <version>1.4.1</version>
+        <version>${mavenResolverVersion}</version>
       </dependency>
 
       <dependency>
@@ -295,6 +297,11 @@
         <artifactId>mockito-inline</artifactId>
         <version>${mockitoVersion}</version>
       </dependency>
+      <dependency>
+        <groupId>org.mockito</groupId>
+        <artifactId>mockito-junit-jupiter</artifactId>
+        <version>${mockitoVersion}</version>
+      </dependency>
       <dependency>
         <groupId>org.hamcrest</groupId>
         <artifactId>hamcrest</artifactId>
diff --git a/versions-common/pom.xml b/versions-common/pom.xml
index 7a14c174..44c22ea7 100644
--- a/versions-common/pom.xml
+++ b/versions-common/pom.xml
@@ -82,28 +82,11 @@
       <groupId>javax.inject</groupId>
       <artifactId>javax.inject</artifactId>
     </dependency>
-
     <dependency>
       <groupId>org.apache.maven.resolver</groupId>
       <artifactId>maven-resolver-util</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.apache.maven.plugin-testing</groupId>
-      <artifactId>maven-plugin-testing-harness</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>org.hamcrest</groupId>
-          <artifactId>hamcrest-core</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-api</artifactId>
@@ -115,19 +98,13 @@
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.junit.vintage</groupId>
-      <artifactId>junit-vintage-engine</artifactId>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
       <scope>test</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>org.hamcrest</groupId>
-          <artifactId>hamcrest-core</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
+      <artifactId>mockito-junit-jupiter</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -145,12 +122,6 @@
       <artifactId>commons-io</artifactId>
       <scope>test</scope>
     </dependency>
-    <!-- Required by Maven Testing Harness -->
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-compat</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
diff --git a/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java b/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java
index 0b49b2ef..596db451 100644
--- a/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java
+++ b/versions-common/src/main/java/org/codehaus/mojo/versions/api/AbstractVersionDetails.java
@@ -92,7 +92,7 @@ public abstract class AbstractVersionDetails implements VersionDetails {
      * or {@link Optional#empty()} if there are no ranges
      */
     protected Optional<Restriction> getSelectedRestriction(ArtifactVersion selectedVersion) {
-        assert selectedVersion != null;
+        Objects.requireNonNull(selectedVersion);
         return Optional.ofNullable(getCurrentVersionRange())
                 .map(VersionRange::getRestrictions)
                 .flatMap(r -> r.stream()
diff --git a/versions-common/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java b/versions-common/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java
index 382348eb..7d5c5094 100644
--- a/versions-common/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java
+++ b/versions-common/src/main/java/org/codehaus/mojo/versions/api/DefaultVersionsHelper.java
@@ -110,6 +110,11 @@ public class DefaultVersionsHelper implements VersionsHelper {
 
     private static final int LOOKUP_PARALLEL_THREADS = 5;
 
+    // for testing purpose
+    RuleSet getRuleSet() {
+        return ruleSet;
+    }
+
     /**
      * The artifact comparison rules to use.
      *
diff --git a/versions-enforcer/pom.xml b/versions-enforcer/pom.xml
index 84f61940..8f8d24b3 100644
--- a/versions-enforcer/pom.xml
+++ b/versions-enforcer/pom.xml
@@ -71,39 +71,20 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.eclipse.sisu</groupId>
-      <artifactId>org.eclipse.sisu.plexus</artifactId>
-      <scope>test</scope>
-    </dependency>
 
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
       <scope>test</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>org.hamcrest</groupId>
-          <artifactId>hamcrest-core</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
-
     <dependency>
-      <groupId>org.junit.vintage</groupId>
-      <artifactId>junit-vintage-engine</artifactId>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
       <scope>test</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>org.hamcrest</groupId>
-          <artifactId>hamcrest-core</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
-
     <dependency>
       <groupId>org.mockito</groupId>
-      <artifactId>mockito-core</artifactId>
+      <artifactId>mockito-junit-jupiter</artifactId>
       <scope>test</scope>
     </dependency>
 
@@ -141,9 +122,6 @@
             <pomInclude>*/pom.xml</pomInclude>
           </pomIncludes>
           <postBuildHookScript>verify</postBuildHookScript>
-          <filterProperties>
-            <repository.proxy.url>${repository.proxy.url}</repository.proxy.url>
-          </filterProperties>
           <mavenOpts>-Xmx256m</mavenOpts>
         </configuration>
       </plugin>
diff --git a/versions-maven-plugin/src/it/it-set-issue-505/invoker.properties b/versions-maven-plugin/src/it/it-set-issue-505/invoker.properties
deleted file mode 100644
index f21410e6..00000000
--- a/versions-maven-plugin/src/it/it-set-issue-505/invoker.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:set
-invoker.mavenOpts = -DnewVersion=TEST
diff --git a/versions-maven-plugin/src/it/it-set-issue-505/moduleA/moduleB/pom.xml b/versions-maven-plugin/src/it/it-set-issue-505/moduleA/moduleB/pom.xml
deleted file mode 100644
index 92023f8d..00000000
--- a/versions-maven-plugin/src/it/it-set-issue-505/moduleA/moduleB/pom.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>default-group</groupId>
-        <artifactId>moduleA</artifactId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>moduleB</artifactId>
-
-</project>
diff --git a/versions-maven-plugin/src/it/it-set-issue-505/moduleA/pom.xml b/versions-maven-plugin/src/it/it-set-issue-505/moduleA/pom.xml
deleted file mode 100644
index 123b5c73..00000000
--- a/versions-maven-plugin/src/it/it-set-issue-505/moduleA/pom.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>default-group</groupId>
-        <artifactId>default-artifact</artifactId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>moduleA</artifactId>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>moduleB/pom.xml</module>
-    </modules>
-
-</project>
diff --git a/versions-maven-plugin/src/it/it-set-issue-505/pom.xml b/versions-maven-plugin/src/it/it-set-issue-505/pom.xml
deleted file mode 100644
index c2a99833..00000000
--- a/versions-maven-plugin/src/it/it-set-issue-505/pom.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>default-group</groupId>
-    <artifactId>default-artifact</artifactId>
-    <version>1.0-SNAPSHOT</version>
-    <packaging>pom</packaging>
-
-    <modules>
-        <module>moduleA/pom.xml</module>
-    </modules>
-
-</project>
diff --git a/versions-maven-plugin/src/it/it-set-issue-505/verify.groovy b/versions-maven-plugin/src/it/it-set-issue-505/verify.groovy
deleted file mode 100644
index 4ebd9521..00000000
--- a/versions-maven-plugin/src/it/it-set-issue-505/verify.groovy
+++ /dev/null
@@ -1,3 +0,0 @@
-assert new File( basedir, "pom.xml" ).text.contains( 'TEST' )
-assert new File( basedir, "moduleA/pom.xml" ).text.contains( 'TEST' )
-assert new File( basedir, "moduleA/moduleB/pom.xml" ).text.contains( 'TEST' )


Test patch:
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/api/AbstractVersionDetailsTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/api/AbstractVersionDetailsTest.java
index d2308eda..618f575f 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/api/AbstractVersionDetailsTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/api/AbstractVersionDetailsTest.java
@@ -21,8 +21,8 @@ import org.apache.maven.artifact.versioning.VersionRange;
 import org.codehaus.mojo.versions.ordering.InvalidSegmentException;
 import org.codehaus.mojo.versions.ordering.MavenVersionComparator;
 import org.codehaus.mojo.versions.ordering.VersionComparator;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import static java.util.Optional.empty;
 import static java.util.Optional.of;
@@ -30,17 +30,17 @@ import static org.codehaus.mojo.versions.api.Segment.MAJOR;
 import static org.codehaus.mojo.versions.utils.ArtifactVersionUtils.version;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /**
  * Unit tests for {@link AbstractVersionDetails}
  */
-public class AbstractVersionDetailsTest {
+class AbstractVersionDetailsTest {
 
     private AbstractVersionDetails instance;
 
-    @Before
-    public void setUp() {
+    @BeforeEach
+    void setUp() {
         instance = new AbstractVersionDetails() {
             @Override
             public VersionComparator getVersionComparator() {
@@ -55,7 +55,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithSimpleVersion() throws InvalidSegmentException {
+    void testRestrictionForUnchangedSegmentWithSimpleVersion() throws InvalidSegmentException {
         assertThat(
                 instance.restrictionForUnchangedSegment(version("1.0.0"), of(MAJOR), false)
                         .containsVersion(version("1.0.0")),
@@ -75,7 +75,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithRange()
+    void testRestrictionForUnchangedSegmentWithRange()
             throws InvalidSegmentException, InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("(0.0.1, 1.0.0]"));
         assertThat(
@@ -97,7 +97,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithTwoRanges()
+    void testRestrictionForUnchangedSegmentWithTwoRanges()
             throws InvalidSegmentException, InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("(0.0.1, 1.0.0],(1.0.0,2.0.0]"));
         assertThat(
@@ -119,7 +119,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges1()
+    void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges1()
             throws InvalidSegmentException, InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("(0.0.1, 1.0.0),(1.0.0,2.0.0]"));
         assertThat(
@@ -129,7 +129,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges2()
+    void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges2()
             throws InvalidSegmentException, InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("(0.0.1, 1.0.0),(1.0.0,2.0.0]"));
         assertThat(
@@ -139,7 +139,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges3()
+    void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges3()
             throws InvalidSegmentException, InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("(0.0.1, 1.0.0),(1.0.0,2.0.0]"));
         assertThat(
@@ -149,7 +149,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges4()
+    void testRestrictionForUnchangedSegmentWithTwoNotConnectingRanges4()
             throws InvalidSegmentException, InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("(0.0.1, 1.0.0),(1.0.0,2.0.0]"));
         assertThat(
@@ -159,7 +159,7 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testRestrictionForUnchangedSegmentWithoutVersionInformation()
+    void testRestrictionForUnchangedSegmentWithoutVersionInformation()
             throws InvalidSegmentException, InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("[,0]"));
         assertThat(
@@ -168,13 +168,8 @@ public class AbstractVersionDetailsTest {
     }
 
     @Test
-    public void testGetSelectedRestrictionForNoVersion()
-            throws InvalidVersionSpecificationException, InvalidSegmentException {
+    void testGetSelectedRestrictionForNoVersion() throws InvalidVersionSpecificationException {
         instance.setCurrentVersionRange(VersionRange.createFromVersionSpec("[,0]"));
-        try {
-            instance.getSelectedRestriction(null);
-            fail("Expected a NullPointerException to be thrown or assertions are not enabled.");
-        } catch (AssertionError ignored) {
-        }
+        assertThrows(NullPointerException.class, () -> instance.getSelectedRestriction(null));
     }
 }
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/api/ArtifactVersionsTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/api/ArtifactVersionsTest.java
index 94040a16..8dd5eaeb 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/api/ArtifactVersionsTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/api/ArtifactVersionsTest.java
@@ -32,7 +32,7 @@ import org.codehaus.mojo.versions.ordering.InvalidSegmentException;
 import org.codehaus.mojo.versions.ordering.MavenVersionComparator;
 import org.codehaus.mojo.versions.ordering.MercuryVersionComparator;
 import org.codehaus.mojo.versions.ordering.VersionComparator;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static java.util.Optional.of;
 import static org.codehaus.mojo.versions.api.Segment.INCREMENTAL;
@@ -47,11 +47,11 @@ import static org.hamcrest.Matchers.arrayWithSize;
 import static org.hamcrest.Matchers.hasToString;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.nullValue;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
-public class ArtifactVersionsTest {
+class ArtifactVersionsTest {
 
     private void test4DigitVersion(VersionComparator comparator) throws InvalidVersionSpecificationException {
         ArtifactVersions instance = new ArtifactVersions(
@@ -101,17 +101,17 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void test4DigitVersionsMercury() throws Exception {
+    void test4DigitVersionsMercury() throws Exception {
         test4DigitVersion(new MercuryVersionComparator());
     }
 
     @Test
-    public void test4DigitVersionsMaven() throws Exception {
+    void test4DigitVersionsMaven() throws Exception {
         test4DigitVersion(new MavenVersionComparator());
     }
 
     @Test
-    public void testIsEmpty() throws Exception {
+    void testIsEmpty() throws Exception {
         ArtifactVersions instance = new ArtifactVersions(
                 new DefaultArtifact(
                         "group",
@@ -128,7 +128,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testSmokes() throws Exception {
+    void testSmokes() throws Exception {
         ArtifactVersions instance = new ArtifactVersions(
                 new DefaultArtifact(
                         "group",
@@ -155,7 +155,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testReportLabels() {
+    void testReportLabels() {
         ArtifactVersions instance = new ArtifactVersions(
                 new DefaultArtifact("default-group", "dummy-api", "1.1", "foo", "bar", "jar", null),
                 Arrays.asList(versions(
@@ -188,7 +188,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testGetNewerVersionsWithSnapshot() throws InvalidSegmentException {
+    void testGetNewerVersionsWithSnapshot() throws InvalidSegmentException {
         ArtifactVersions instance = new ArtifactVersions(
                 new DefaultArtifact("default-group", "dummy-api", "1.0.0-SNAPSHOT", "foo", "bar", "jar", null),
                 Arrays.asList(versions("1.0.0-SNAPSHOT", "1.0.0")),
@@ -207,7 +207,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testAllVersionsForIgnoreScopeSubIncremental() {
+    void testAllVersionsForIgnoreScopeSubIncremental() {
         ArtifactVersions instance = createInstance(versions("1.0.0", "1.0.0-1", "1.0.1"));
         ArtifactVersion[] filteredVersions = instance.getVersions(
                 instance.restrictionForIgnoreScope(instance.getCurrentVersion(), of(SUBINCREMENTAL)), false);
@@ -216,7 +216,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testAllVersionsForIgnoreScopeIncremental() {
+    void testAllVersionsForIgnoreScopeIncremental() {
         ArtifactVersions instance = createInstance(versions("1.0.0", "1.0.0-1", "1.0.1", "1.1.0"));
         ArtifactVersion[] filteredVersions = instance.getVersions(
                 instance.restrictionForIgnoreScope(instance.getCurrentVersion(), of(INCREMENTAL)), false);
@@ -225,7 +225,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testAllVersionsForIgnoreScopeMinor() {
+    void testAllVersionsForIgnoreScopeMinor() {
         ArtifactVersions instance = createInstance(versions("1.0.0", "1.0.0-1", "1.0.1", "1.1.0", "2.0.0"));
         ArtifactVersion[] filteredVersions = instance.getVersions(
                 instance.restrictionForIgnoreScope(instance.getCurrentVersion(), of(MINOR)), false);
@@ -234,7 +234,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testAllVersionsForIgnoreScopeMajor() {
+    void testAllVersionsForIgnoreScopeMajor() {
         ArtifactVersions instance = createInstance(versions("1.0.0", "1.0.0-1", "1.0.1", "1.1.0", "2.0.0"));
         ArtifactVersion[] filteredVersions = instance.getVersions(
                 instance.restrictionForIgnoreScope(instance.getCurrentVersion(), of(MAJOR)), false);
@@ -242,7 +242,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testGetReportNewestUpdateWithOnlyMajorUpdate() {
+    void testGetReportNewestUpdateWithOnlyMajorUpdate() {
         ArtifactVersions instance = createInstance(versions("1.0.0", "2.0.0"));
         assertThat(instance.getReportNewestUpdate(Optional.empty(), true).toString(), is("2.0.0"));
         assertThat(instance.getReportNewestUpdate(of(MAJOR), true), hasToString("2.0.0"));
@@ -252,7 +252,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testGetReportNewestUpdateWithMinorAndMajor() {
+    void testGetReportNewestUpdateWithMinorAndMajor() {
         ArtifactVersions instance = createInstance(versions("1.0.0", "1.1.0", "2.0.0"));
         assertThat(instance.getReportNewestUpdate(Optional.empty(), true).toString(), is("2.0.0"));
         assertThat(instance.getReportNewestUpdate(of(MAJOR), true), hasToString("2.0.0"));
@@ -262,7 +262,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testGetReportNewestUpdateWithIncrementalAndMajor() {
+    void testGetReportNewestUpdateWithIncrementalAndMajor() {
         ArtifactVersions instance = createInstance(versions("1.0.0", "1.0.1", "2.0.0"));
         assertThat(instance.getReportNewestUpdate(Optional.empty(), true).toString(), is("2.0.0"));
         assertThat(instance.getReportNewestUpdate(of(MAJOR), true), hasToString("2.0.0"));
@@ -272,7 +272,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testGetNewestVersionWithLesserSegment() throws InvalidSegmentException {
+    void testGetNewestVersionWithLesserSegment() throws InvalidSegmentException {
         ArtifactVersions instance = createInstance(versions("1.0.0-1"));
         assertThat(instance.getNewestVersion("1.0.0", of(MAJOR), false, false).get(), hasToString("1.0.0-1"));
         assertThat(instance.getNewestVersion("1.0.0", of(MINOR), false, false).get(), hasToString("1.0.0-1"));
@@ -283,7 +283,7 @@ public class ArtifactVersionsTest {
     }
 
     @Test
-    public void testGetNewestVersionWithLesserSegmentWithSnapshots() throws InvalidSegmentException {
+    void testGetNewestVersionWithLesserSegmentWithSnapshots() throws InvalidSegmentException {
         ArtifactVersions instance = createInstance(versions("1.0.0-1-SNAPSHOT"));
         assertThat(instance.getNewestVersion("1.0.0", of(MAJOR), true, false).get(), hasToString("1.0.0-1-SNAPSHOT"));
         assertThat(instance.getNewestVersion("1.0.0", of(MINOR), true, false).get(), hasToString("1.0.0-1-SNAPSHOT"));
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/api/DefaultVersionsHelperTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/api/DefaultVersionsHelperTest.java
index 8f30de00..fe230eda 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/api/DefaultVersionsHelperTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/api/DefaultVersionsHelperTest.java
@@ -31,14 +31,13 @@ import java.util.Objects;
 import java.util.stream.Collectors;
 
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecution;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugin.logging.SystemStreamLog;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.plugin.testing.stubs.DefaultArtifactHandlerStub;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.repository.RepositorySystem;
 import org.apache.maven.wagon.ConnectionException;
@@ -53,15 +52,16 @@ import org.codehaus.mojo.versions.model.IgnoreVersion;
 import org.codehaus.mojo.versions.model.Rule;
 import org.codehaus.mojo.versions.model.RuleSet;
 import org.codehaus.mojo.versions.ordering.VersionComparators;
-import org.codehaus.mojo.versions.utils.VersionStub;
 import org.eclipse.aether.DefaultRepositorySystemSession;
 import org.eclipse.aether.repository.RemoteRepository;
 import org.eclipse.aether.repository.RepositoryPolicy;
 import org.eclipse.aether.resolution.VersionRangeRequest;
 import org.eclipse.aether.resolution.VersionRangeResult;
+import org.eclipse.aether.util.version.GenericVersionScheme;
+import org.eclipse.aether.version.InvalidVersionSpecificationException;
 import org.eclipse.aether.version.Version;
 import org.hamcrest.CoreMatchers;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
 import static java.util.Collections.emptyList;
@@ -74,6 +74,9 @@ import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.Matchers.is;
 import static org.hamcrest.Matchers.not;
 import static org.hamcrest.core.IsIterableContaining.hasItems;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.doAnswer;
@@ -84,7 +87,7 @@ import static org.mockito.Mockito.when;
 /**
  * Test {@link DefaultVersionsHelper}
  */
-public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
+class DefaultVersionsHelperTest {
     @Test
     public void testPerRuleVersionsIgnored() throws Exception {
         final org.eclipse.aether.RepositorySystem repositorySystem = mock(org.eclipse.aether.RepositorySystem.class);
@@ -92,15 +95,15 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
         when(artifact.getGroupId()).thenReturn("com.mycompany.maven");
         when(artifact.getArtifactId()).thenReturn("artifact-one");
         when(artifact.getType()).thenReturn("jar");
-        when(artifact.getArtifactHandler()).thenReturn(new DefaultArtifactHandlerStub("default"));
+        when(artifact.getArtifactHandler()).thenReturn(new DefaultArtifactHandler("default"));
         when(repositorySystem.resolveVersionRange(any(), any(VersionRangeRequest.class)))
                 .then(i -> new VersionRangeResult(i.getArgument(1))
                         .setVersions(Arrays.asList(
-                                new VersionStub("one"),
-                                new VersionStub("two"),
-                                new VersionStub("three"),
-                                new VersionStub("1.200"),
-                                new VersionStub("illegalVersion"))));
+                                parseVersion("one"),
+                                parseVersion("two"),
+                                parseVersion("three"),
+                                parseVersion("1.200"),
+                                parseVersion("illegalVersion"))));
 
         VersionsHelper helper = createHelper(repositorySystem);
 
@@ -121,19 +124,19 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
         when(artifact.getGroupId()).thenReturn("other.company");
         when(artifact.getArtifactId()).thenReturn("artifact-two");
         when(artifact.getType()).thenReturn("jar");
-        when(artifact.getArtifactHandler()).thenReturn(new DefaultArtifactHandlerStub("default"));
+        when(artifact.getArtifactHandler()).thenReturn(new DefaultArtifactHandler("default"));
 
         final List<Version> artifactVersions = new ArrayList<>();
 
-        final Version one = new VersionStub("one");
-        final Version two = new VersionStub("two");
-        final Version three = new VersionStub("three");
+        final Version one = parseVersion("one");
+        final Version two = parseVersion("two");
+        final Version three = parseVersion("three");
         artifactVersions.add(one);
         artifactVersions.add(two);
-        artifactVersions.add(new VersionStub("three-alpha"));
-        artifactVersions.add(new VersionStub("three-beta"));
+        artifactVersions.add(parseVersion("three-alpha"));
+        artifactVersions.add(parseVersion("three-beta"));
         artifactVersions.add(three);
-        final Version illegal = new VersionStub("illegalVersion");
+        final Version illegal = parseVersion("illegalVersion");
         artifactVersions.add(illegal);
 
         when(repositorySystem.resolveVersionRange(any(), any(VersionRangeRequest.class)))
@@ -145,7 +148,7 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
 
         final List<Version> actual = Arrays.stream(versions.getVersions(true))
                 .map(ArtifactVersion::toString)
-                .map(VersionStub::new)
+                .map(DefaultVersionsHelperTest::parseVersion)
                 .collect(Collectors.toList());
 
         assertEquals(4, actual.size());
@@ -166,21 +169,21 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
         VersionsHelper helper = createHelper();
 
         assertEquals(
-                "no match gives default",
                 VersionComparators.getVersionComparator("maven"),
-                helper.getVersionComparator("net.foo", "bar"));
+                helper.getVersionComparator("net.foo", "bar"),
+                "no match gives default");
         assertEquals(
-                "matches wildcard",
                 VersionComparators.getVersionComparator("mercury"),
-                helper.getVersionComparator("org.apache.maven", "plugins"));
+                helper.getVersionComparator("org.apache.maven", "plugins"),
+                "matches wildcard");
         assertEquals(
-                "exact match wins over initial match",
                 VersionComparators.getVersionComparator("mercury"),
-                helper.getVersionComparator("com.mycompany.custom.maven", "plugins"));
+                helper.getVersionComparator("com.mycompany.custom.maven", "plugins"),
+                "exact match wins over initial match");
         assertEquals(
-                "non-wildcard prefix wins over wildcard prefix match",
                 VersionComparators.getVersionComparator("maven"),
-                helper.getVersionComparator("com.mycompany.maven.plugins", "plugins"));
+                helper.getVersionComparator("com.mycompany.maven.plugins", "plugins"),
+                "non-wildcard prefix wins over wildcard prefix match");
         assertEquals(
                 VersionComparators.getVersionComparator("maven"),
                 helper.getVersionComparator("com.mycompany.maven", "new-maven-plugin"));
@@ -190,7 +193,7 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testMVERSIONS159ExcludedAndNotIncluded() throws Exception {
+    void testMVERSIONS159ExcludedAndNotIncluded() throws Exception {
         VersionsHelper helper = createHelper();
         MavenProject project = null;
 
@@ -209,14 +212,14 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testIsClasspathUriDetectsClassPathProtocol() throws Exception {
+    void testIsClasspathUriDetectsClassPathProtocol() throws Exception {
         String uri = "classpath:/p/a/c/k/a/g/e/resource.res";
 
         assertThat(DefaultVersionsHelper.isClasspathUri(uri), CoreMatchers.is(true));
     }
 
     @Test
-    public void testIsClasspathUriDetectsThatItIsDifferentProtocol() throws Exception {
+    void testIsClasspathUriDetectsThatItIsDifferentProtocol() throws Exception {
         String uri = "http://10.10.10.10/p/a/c/k/a/g/e/resource.res";
 
         assertThat(DefaultVersionsHelper.isClasspathUri(uri), CoreMatchers.is(false));
@@ -258,7 +261,7 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
         when(mavenSession.getRepositorySession()).thenReturn(new DefaultRepositorySystemSession());
 
         return new DefaultVersionsHelper.Builder()
-                .withRepositorySystem(lookup(RepositorySystem.class))
+                .withRepositorySystem(mock(RepositorySystem.class))
                 .withAetherRepositorySystem(aetherRepositorySystem)
                 .withWagonMap(singletonMap("file", mockFileWagon(new URI(rulesUri))))
                 .withServerId("")
@@ -270,13 +273,12 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testIgnoredVersionsShouldBeTheOnlyPresentInAnEmptyRuleSet()
-            throws MojoExecutionException, IllegalAccessException {
+    void testIgnoredVersionsShouldBeTheOnlyPresentInAnEmptyRuleSet() throws MojoExecutionException {
         DefaultVersionsHelper versionsHelper = new DefaultVersionsHelper.Builder()
                 .withLog(new SystemStreamLog())
                 .withIgnoredVersions(Arrays.asList(".*-M.", ".*-SNAPSHOT"))
                 .build();
-        RuleSet ruleSet = (RuleSet) getVariableValueFromObject(versionsHelper, "ruleSet");
+        RuleSet ruleSet = versionsHelper.getRuleSet();
         assertThat(ruleSet.getIgnoreVersions(), hasSize(2));
         assertThat(
                 ruleSet.getIgnoreVersions().stream()
@@ -286,17 +288,17 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testDefaultsShouldBePresentInAnEmptyRuleSet() throws MojoExecutionException, IllegalAccessException {
+    void testDefaultsShouldBePresentInAnEmptyRuleSet() throws MojoExecutionException, IllegalAccessException {
         DefaultVersionsHelper versionsHelper = new DefaultVersionsHelper.Builder()
                 .withLog(new SystemStreamLog())
                 .withIgnoredVersions(singletonList(".*-M."))
                 .build();
-        RuleSet ruleSet = (RuleSet) getVariableValueFromObject(versionsHelper, "ruleSet");
+        RuleSet ruleSet = versionsHelper.getRuleSet();
         assertThat(ruleSet.getComparisonMethod(), is("maven"));
     }
 
     @Test
-    public void testIgnoredVersionsShouldExtendTheRuleSet() throws MojoExecutionException, IllegalAccessException {
+    void testIgnoredVersionsShouldExtendTheRuleSet() throws MojoExecutionException, IllegalAccessException {
         DefaultVersionsHelper versionsHelper = new DefaultVersionsHelper.Builder()
                 .withLog(new SystemStreamLog())
                 .withRuleSet(new RuleSet() {
@@ -322,7 +324,7 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
                 })
                 .withIgnoredVersions(Arrays.asList(".*-M.", ".*-SNAPSHOT"))
                 .build();
-        RuleSet ruleSet = (RuleSet) getVariableValueFromObject(versionsHelper, "ruleSet");
+        RuleSet ruleSet = versionsHelper.getRuleSet();
         assertThat(ruleSet.getIgnoreVersions(), hasSize(3));
         assertThat(
                 ruleSet.getIgnoreVersions().stream()
@@ -332,7 +334,7 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testRemoteRepositoryWithNeverUpdatePolicyShouldBeChangToDaily() {
+    void testRemoteRepositoryWithNeverUpdatePolicyShouldBeChangToDaily() {
 
         RemoteRepository repo1 = new RemoteRepository.Builder("id1", "", "")
                 .setSnapshotPolicy(new RepositoryPolicy(
@@ -377,4 +379,12 @@ public class DefaultVersionsHelperTest extends AbstractMojoTestCase {
                 remoteRepositories.get(1).getPolicy(false).getUpdatePolicy(),
                 equalTo(RepositoryPolicy.UPDATE_POLICY_DAILY));
     }
+
+    private static Version parseVersion(String version) {
+        try {
+            return new GenericVersionScheme().parseVersion(version);
+        } catch (InvalidVersionSpecificationException e) {
+            throw new RuntimeException(e);
+        }
+    }
 }
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/api/PomHelperTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/api/PomHelperTest.java
index 0ed517cb..0c885c8f 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/api/PomHelperTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/api/PomHelperTest.java
@@ -41,37 +41,35 @@ import org.apache.maven.model.io.ModelWriter;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.plugin.logging.SystemStreamLog;
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.apache.maven.plugin.testing.MojoRule;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.mojo.versions.rewriting.ModifiedPomXMLEventReader;
 import org.codehaus.mojo.versions.utils.ModelNode;
 import org.codehaus.stax2.XMLInputFactory2;
 import org.hamcrest.MatcherAssert;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
 
 import static org.codehaus.mojo.versions.utils.ModifiedPomXMLEventReaderUtils.matches;
 import static org.codehaus.stax2.XMLInputFactory2.P_PRESERVE_LOCATION;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.hasSize;
 import static org.hamcrest.core.Is.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.mock;
 
 /**
  * Tests the methods of {@link PomHelper}.
  */
-public class PomHelperTest extends AbstractMojoTestCase {
+class PomHelperTest {
     private static final int NUMBER_OF_CHILD_PROJECTS = 30;
 
-    @Rule
-    public MojoRule mojoRule = new MojoRule(this);
-
     private static final XMLInputFactory INPUT_FACTORY = XMLInputFactory2.newInstance();
 
-    @BeforeClass
-    public static void setUpClass() {
+    @BeforeAll
+    static void setUpClass() {
         INPUT_FACTORY.setProperty(P_PRESERVE_LOCATION, Boolean.TRUE);
     }
 
@@ -82,7 +80,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
      * @throws Exception if the test fails.
      */
     @Test
-    public void testLongProperties() throws Exception {
+    void testLongProperties() throws Exception {
         URL url = getClass().getResource("PomHelperTest.testLongProperties.pom.xml");
         assert url != null;
         File file = new File(url.getPath());
@@ -97,7 +95,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
 
         String newVersion = "1";
 
-        assertTrue("The pom has been modified", PomHelper.setProjectVersion(pom, newVersion));
+        assertTrue(PomHelper.setProjectVersion(pom, newVersion), "The pom has been modified");
 
         assertEquals(newVersion, PomHelper.getProjectVersion(pom));
 
@@ -105,7 +103,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testGroupIdNotOnChildPom() throws Exception {
+    void testGroupIdNotOnChildPom() throws Exception {
         URL url = getClass().getResource("PomHelperTest.noGroupIdOnChild.pom.xml");
         assert url != null;
         StringBuilder input = PomHelper.readXmlFile(new File(url.getPath()));
@@ -116,67 +114,67 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testVersionVersionEqual() throws Exception {
+    void testVersionVersionEqual() throws Exception {
         assertTrue(PomHelper.isVersionOverlap("1.0.8", "1.0.8"));
     }
 
     @Test
-    public void testVersionVersionDiffer() throws Exception {
+    void testVersionVersionDiffer() throws Exception {
         assertFalse(PomHelper.isVersionOverlap("1.0.8", "1.0.0"));
     }
 
     @Test
-    public void testVersionRangeIntersect() throws Exception {
+    void testVersionRangeIntersect() throws Exception {
         assertTrue(PomHelper.isVersionOverlap("1.0.8", "[1.0.3,1.1.0]"));
     }
 
     @Test
-    public void testVersionRangeDisjoint() throws Exception {
+    void testVersionRangeDisjoint() throws Exception {
         assertFalse(PomHelper.isVersionOverlap("1.0.8", "[0.0.1,1.0.0]"));
     }
 
     @Test
-    public void testVersionLeftOpenRangeDisjoint() throws Exception {
+    void testVersionLeftOpenRangeDisjoint() throws Exception {
         assertFalse(PomHelper.isVersionOverlap("1.0.8", "[,1.0.0]"));
     }
 
     @Test
-    public void testVersionRightOpenRangeDisjoint() throws Exception {
+    void testVersionRightOpenRangeDisjoint() throws Exception {
         assertFalse(PomHelper.isVersionOverlap("1.0.8", "[1.1.0,)"));
     }
 
     @Test
-    public void testEmptyRange() throws Exception {
+    void testEmptyRange() throws Exception {
         assertTrue(PomHelper.isVersionOverlap("1.0.8", ""));
     }
 
     @Test
-    public void testRangeEmpty() throws Exception {
+    void testRangeEmpty() throws Exception {
         assertTrue(PomHelper.isVersionOverlap("[1.0.5,1.0.8]", ""));
     }
 
     @Test
-    public void testRangeRangeIntersect() throws Exception {
+    void testRangeRangeIntersect() throws Exception {
         assertTrue(PomHelper.isVersionOverlap("[1.0.5,1.0.8]", "[1.0.7,1.1.0]"));
     }
 
     @Test
-    public void testRangeRangeDisjoint() throws Exception {
+    void testRangeRangeDisjoint() throws Exception {
         assertFalse(PomHelper.isVersionOverlap("[1.0.5,1.0.6]", "[1.0.7,1.1.0]"));
     }
 
     @Test
-    public void testRangeVersionDisjoint() throws Exception {
+    void testRangeVersionDisjoint() throws Exception {
         assertFalse(PomHelper.isVersionOverlap("[1.0.5,1.0.6]", "1.0.8"));
     }
 
     @Test
-    public void testRangeVersionIntersect() throws Exception {
+    void testRangeVersionIntersect() throws Exception {
         assertTrue(PomHelper.isVersionOverlap("[1.0.0,2.0.0]", "1.0.8"));
     }
 
     @Test
-    public void testSetElementValueExistingValue() throws XMLStreamException {
+    void testSetElementValueExistingValue() throws XMLStreamException {
         ModifiedPomXMLEventReader xmlEventReader = new ModifiedPomXMLEventReader(
                 new StringBuilder("<super-parent><parent><child>test</child></parent></super-parent>"),
                 INPUT_FACTORY,
@@ -188,7 +186,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testSetElementValueEmptyChild() throws XMLStreamException {
+    void testSetElementValueEmptyChild() throws XMLStreamException {
         ModifiedPomXMLEventReader xmlEventReader = new ModifiedPomXMLEventReader(
                 new StringBuilder("<super-parent><parent><child/></parent></super-parent>"), INPUT_FACTORY, null);
 
@@ -198,7 +196,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testSetElementValueNewValueEmptyParent() throws XMLStreamException {
+    void testSetElementValueNewValueEmptyParent() throws XMLStreamException {
         ModifiedPomXMLEventReader xmlEventReader = new ModifiedPomXMLEventReader(
                 new StringBuilder("<super-parent><parent/></super-parent>"), INPUT_FACTORY, null);
 
@@ -208,7 +206,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testSetElementValueNewValueNoChild() throws XMLStreamException {
+    void testSetElementValueNewValueNoChild() throws XMLStreamException {
         ModifiedPomXMLEventReader xmlEventReader = new ModifiedPomXMLEventReader(
                 new StringBuilder("<super-parent><parent><child2/></parent></super-parent>"), INPUT_FACTORY, null);
 
@@ -218,7 +216,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testSetProjectValueNewValueNonEmptyParent() throws XMLStreamException {
+    void testSetProjectValueNewValueNonEmptyParent() throws XMLStreamException {
         ModifiedPomXMLEventReader xmlEventReader = new ModifiedPomXMLEventReader(
                 new StringBuilder("<super-parent><parent><child>test</child></parent></super-parent>"),
                 INPUT_FACTORY,
@@ -230,14 +228,14 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testIssue505ChildModules() throws Exception {
-        MavenProject project =
-                mojoRule.readMavenProject(new File("src/test/resources/org/codehaus/mojo/versions/api/issue-505"));
+    void testIssue505ChildModules() throws Exception {
+        MavenProject project = new MavenProject();
+        project.setFile(new File("src/test/resources/org/codehaus/mojo/versions/api/issue-505/pom.xml"));
         assertThat(PomHelper.getChildModels(project, new SystemStreamLog()).entrySet(), hasSize(3));
     }
 
     @Test
-    public void testChildModelsForMultiLevelProject() throws Exception {
+    void testChildModelsForMultiLevelProject() throws Exception {
         Path tempDirectory = Files.createTempDirectory("testChildModelsForLargeNumberOfModules");
         ModelWriter modelWriter = new DefaultModelWriter();
         Map<Path, Model> createdModels = new LinkedHashMap<>();
@@ -263,7 +261,8 @@ public class PomHelperTest extends AbstractMojoTestCase {
                 modelWriter.write(entry.getKey().resolve("pom.xml").toFile(), Collections.emptyMap(), entry.getValue());
             }
 
-            MavenProject project = mojoRule.readMavenProject(tempDirectory.toFile());
+            MavenProject project = new MavenProject();
+            project.setFile(tempDirectory.resolve("pom.xml").toFile());
 
             assertThat(
                     PomHelper.getChildModels(project, new SystemStreamLog()).entrySet(), hasSize(createdModels.size()));
@@ -283,7 +282,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testGetRawModelTree() throws Exception {
+    void testGetRawModelTree() throws Exception {
         Log log = mock(Log.class);
         XMLInputFactory inputFactory = XMLInputFactory2.newInstance();
         inputFactory.setProperty(XMLInputFactory2.P_PRESERVE_LOCATION, Boolean.TRUE);
@@ -301,7 +300,7 @@ public class PomHelperTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testFindProperty() throws Exception {
+    void testFindProperty() throws Exception {
         Log log = mock(Log.class);
         XMLInputFactory inputFactory = XMLInputFactory2.newInstance();
         inputFactory.setProperty(XMLInputFactory2.P_PRESERVE_LOCATION, Boolean.TRUE);
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/BoundArtifactVersionTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/BoundArtifactVersionTest.java
index 18bad591..0b463733 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/BoundArtifactVersionTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/BoundArtifactVersionTest.java
@@ -20,7 +20,7 @@ package org.codehaus.mojo.versions.ordering;
 
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.codehaus.mojo.versions.utils.DefaultArtifactVersionCache;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.codehaus.mojo.versions.api.Segment.INCREMENTAL;
 import static org.codehaus.mojo.versions.api.Segment.MAJOR;
@@ -33,58 +33,58 @@ import static org.hamcrest.Matchers.lessThan;
 /**
  * Unit tests for {@link BoundArtifactVersion}
  */
-public class BoundArtifactVersionTest {
+class BoundArtifactVersionTest {
     @Test
-    public void testMajorUpperBoundGreaterThanNextMajor() {
+    void testMajorUpperBoundGreaterThanNextMajor() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.2.3", MAJOR);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("2.0.0");
         assertThat(bound.compareTo(artifactVersion), greaterThan(0));
     }
 
     @Test
-    public void testSubIncrementalUpperBoundGreaterThanNextSubIncremental() {
+    void testSubIncrementalUpperBoundGreaterThanNextSubIncremental() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.2.3-2", SUBINCREMENTAL);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("1.2.3-3");
         assertThat(bound.compareTo(artifactVersion), greaterThan(0));
     }
 
     @Test
-    public void testVersionShorterThanSegment() {
+    void testVersionShorterThanSegment() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.1", INCREMENTAL);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("1.1.3");
         assertThat(bound.compareTo(artifactVersion), greaterThan(0));
     }
 
     @Test
-    public void testVersionBoundArtifactVersionShorterThanConcreteVersionAndSegment() {
+    void testVersionBoundArtifactVersionShorterThanConcreteVersionAndSegment() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.1", SUBINCREMENTAL);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("1.1.3");
         assertThat(bound.compareTo(artifactVersion), lessThan(0));
     }
 
     @Test
-    public void testVersionSubIncrementalBoundGreaterThanSubIncremental() {
+    void testVersionSubIncrementalBoundGreaterThanSubIncremental() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.1", SUBINCREMENTAL);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("1.1.0-2");
         assertThat(bound.compareTo(artifactVersion), greaterThan(0));
     }
 
     @Test
-    public void testVersionSubIncrementalBoundGreaterThanIncremental() {
+    void testVersionSubIncrementalBoundGreaterThanIncremental() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.1", INCREMENTAL);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("1.1.3");
         assertThat(bound.compareTo(artifactVersion), greaterThan(0));
     }
 
     @Test
-    public void testVersionSubIncrementalBoundGreaterThanMinor() {
+    void testVersionSubIncrementalBoundGreaterThanMinor() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.1", MINOR);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("1.3");
         assertThat(bound.compareTo(artifactVersion), greaterThan(0));
     }
 
     @Test
-    public void testSnapshotWithSubIncremental() {
+    void testSnapshotWithSubIncremental() {
         BoundArtifactVersion bound = new BoundArtifactVersion("1.0.0-SNAPSHOT", MINOR);
         ArtifactVersion artifactVersion = DefaultArtifactVersionCache.of("1.0.0");
         assertThat(bound.compareTo(artifactVersion), greaterThan(0));
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MavenVersionComparatorTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MavenVersionComparatorTest.java
index 1a072c2d..53e8046d 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MavenVersionComparatorTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MavenVersionComparatorTest.java
@@ -20,7 +20,7 @@ package org.codehaus.mojo.versions.ordering;
  */
 
 import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.codehaus.mojo.versions.api.Segment.INCREMENTAL;
 import static org.codehaus.mojo.versions.api.Segment.SUBINCREMENTAL;
@@ -29,13 +29,13 @@ import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.lessThan;
 import static org.hamcrest.core.Is.is;
 
-public class MavenVersionComparatorTest extends VersionComparatorTestBase {
-    public MavenVersionComparatorTest() {
+class MavenVersionComparatorTest extends VersionComparatorTestBase {
+    MavenVersionComparatorTest() {
         super(new MavenVersionComparator());
     }
 
     @Test
-    public void testSegmentCounting() {
+    void testSegmentCounting() {
         assertThat(3, is(instance.getSegmentCount(version("5"))));
         assertThat(3, is(instance.getSegmentCount(version("5.0"))));
         assertThat(4, is(instance.getSegmentCount(version("5-0"))));
@@ -45,28 +45,28 @@ public class MavenVersionComparatorTest extends VersionComparatorTestBase {
     }
 
     @Test
-    public void testUpperBoundaryCustom() {
+    void testUpperBoundaryCustom() {
         assertThat(
                 instance.compare(new BoundArtifactVersion(version("1.2.3"), INCREMENTAL), version("1.2.3-ANDRZEJ")),
                 greaterThan(0));
     }
 
     @Test
-    public void testUpperBoundaryRelease() {
+    void testUpperBoundaryRelease() {
         assertThat(
                 instance.compare(new BoundArtifactVersion(version("1.1.0"), INCREMENTAL), version("1.1.0")),
                 greaterThan(0));
     }
 
     @Test
-    public void testUpperBoundarySnapshot() {
+    void testUpperBoundarySnapshot() {
         assertThat(
                 instance.compare(new BoundArtifactVersion(version("1.1.0"), INCREMENTAL), version("1.1.0-SNAPSHOT")),
                 greaterThan(0));
     }
 
     @Test
-    public void testScopeLessThanNumSegmentsUpper() {
+    void testScopeLessThanNumSegmentsUpper() {
         ArtifactVersion artifactVersion = new BoundArtifactVersion(version("1.1"), SUBINCREMENTAL);
         assertThat(artifactVersion.compareTo(version("1.0.1")), greaterThan(0));
         assertThat(artifactVersion.compareTo(version("1.1-SNAPSHOT")), greaterThan(0));
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MercuryVersionComparatorTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MercuryVersionComparatorTest.java
index 3ed017eb..db1ab45f 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MercuryVersionComparatorTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/MercuryVersionComparatorTest.java
@@ -20,17 +20,17 @@ package org.codehaus.mojo.versions.ordering;
  */
 
 import org.codehaus.mojo.versions.utils.DefaultArtifactVersionCache;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-public class MercuryVersionComparatorTest extends VersionComparatorTestBase {
-    public MercuryVersionComparatorTest() {
+class MercuryVersionComparatorTest extends VersionComparatorTestBase {
+    MercuryVersionComparatorTest() {
         super(new MercuryVersionComparator());
     }
 
     @Test
-    public void testSegmentCounting() {
+    void testSegmentCounting() {
         assertEquals(1, instance.getSegmentCount(DefaultArtifactVersionCache.of("5")));
         assertEquals(2, instance.getSegmentCount(DefaultArtifactVersionCache.of("5.0")));
         assertEquals(2, instance.getSegmentCount(DefaultArtifactVersionCache.of("5-0")));
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/NumericVersionComparatorTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/NumericVersionComparatorTest.java
index 1200442d..c064f8f4 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/NumericVersionComparatorTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/NumericVersionComparatorTest.java
@@ -20,13 +20,13 @@ package org.codehaus.mojo.versions.ordering;
  */
 
 import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
-public class NumericVersionComparatorTest extends VersionComparatorTestBase {
-    public NumericVersionComparatorTest() {
+class NumericVersionComparatorTest extends VersionComparatorTestBase {
+    NumericVersionComparatorTest() {
         super(new NumericVersionComparator());
     }
 
@@ -35,7 +35,7 @@ public class NumericVersionComparatorTest extends VersionComparatorTestBase {
     }
 
     @Test
-    public void testSmokes() {
+    void testSmokes() {
         assertTrue(instanceCompare("1.0.0.0.0", "1.0.0.0.1") < 0);
         assertTrue(instanceCompare("1.0.0.0.0", "2.0.0.0.1") < 0);
         assertTrue(instanceCompare("1.0.0.0.0", "1.0.0.0") < 0);
@@ -44,14 +44,14 @@ public class NumericVersionComparatorTest extends VersionComparatorTestBase {
     }
 
     @Test
-    public void testBigValues() {
+    void testBigValues() {
         assertTrue(instanceCompare("1.92.0", "1.100000000000000000000000.0") < 0);
         assertTrue(instanceCompare("1.100000000000000000000000.0", "1.92.0") > 0);
         assertTrue(instanceCompare("1.100000000000000000000000.0", "1.100000000000000000000000.0") == 0);
     }
 
     @Test
-    public void testStringValues() {
+    void testStringValues() {
         assertTrue(instanceCompare("1.a20.0", "1.a3.0") < 0);
         assertTrue(instanceCompare("1.a20.0", "1.b10.0") < 0);
         assertTrue(instanceCompare("1.a.0.b.0", "1.a.0.b.1") < 0);
@@ -71,7 +71,7 @@ public class NumericVersionComparatorTest extends VersionComparatorTestBase {
     }
 
     @Test
-    public void testQualifiers() {
+    void testQualifiers() {
         assertTrue(instanceCompare("1.0-alpha.10", "1.0-alpha.20") < 0);
         assertTrue(instanceCompare("1.0-alpha.10", "1.0-beta.1") < 0);
         assertTrue(instanceCompare("1.0", "1.0-alpha.2") > 0);
@@ -80,7 +80,7 @@ public class NumericVersionComparatorTest extends VersionComparatorTestBase {
     }
 
     @Test
-    public void testSegmentCounting() {
+    void testSegmentCounting() {
         assertEquals(1, instance.getSegmentCount(new DefaultArtifactVersion("5")));
         assertEquals(2, instance.getSegmentCount(new DefaultArtifactVersion("5.0")));
         assertEquals(1, instance.getSegmentCount(new DefaultArtifactVersion("5-0")));
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/VersionComparatorTestBase.java b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/VersionComparatorTestBase.java
index 81721fb0..431651e7 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/VersionComparatorTestBase.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/ordering/VersionComparatorTestBase.java
@@ -21,7 +21,7 @@ package org.codehaus.mojo.versions.ordering;
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.codehaus.mojo.versions.api.Segment;
 import org.codehaus.mojo.versions.utils.DefaultArtifactVersionCache;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.greaterThan;
@@ -31,10 +31,10 @@ import static org.hamcrest.Matchers.lessThan;
  * Abstract base class for {@link MavenVersionComparatorTest}, {@link MercuryVersionComparatorTest},
  * and {@link NumericVersionComparatorTest}
  */
-public abstract class VersionComparatorTestBase {
+abstract class VersionComparatorTestBase {
     protected final VersionComparator instance;
 
-    public VersionComparatorTestBase(VersionComparator instance) {
+    VersionComparatorTestBase(VersionComparator instance) {
         this.instance = instance;
     }
 
@@ -43,7 +43,7 @@ public abstract class VersionComparatorTestBase {
     }
 
     @Test
-    public void testVersionComparatorRow1() {
+    void testVersionComparatorRow1() {
         assertThat(instance.compare(version("1"), version("2")), lessThan(0));
         assertThat(instance.compare(version("1.0"), version("2.0")), lessThan(0));
         assertThat(instance.compare(version("1.0"), version("1.1")), lessThan(0));
@@ -51,20 +51,20 @@ public abstract class VersionComparatorTestBase {
     }
 
     @Test
-    public void testVersionComparatorRow2() {
+    void testVersionComparatorRow2() {
         assertThat(instance.compare(version("1.0"), version("2.0")), lessThan(0));
         assertThat(instance.compare(version("1.0"), version("1.1")), lessThan(0));
     }
 
     @Test
-    public void testVersionComparatorRow3() {
+    void testVersionComparatorRow3() {
         assertThat(instance.compare(version("1.0.0"), version("2.0.0")), lessThan(0));
         assertThat(instance.compare(version("1.0.0"), version("1.1.0")), lessThan(0));
         assertThat(instance.compare(version("1.0.0"), version("1.0.1")), lessThan(0));
     }
 
     @Test
-    public void testVersionComparatorRow4() {
+    void testVersionComparatorRow4() {
         assertThat(instance.compare(version("1.0.0-1"), version("2.0.0-1")), lessThan(0));
         assertThat(instance.compare(version("1.0.0-1"), version("1.1.0-1")), lessThan(0));
         assertThat(instance.compare(version("1.0.0-1"), version("1.0.1-1")), lessThan(0));
@@ -72,7 +72,7 @@ public abstract class VersionComparatorTestBase {
     }
 
     @Test
-    public void testVersionComparatorRow5() {
+    void testVersionComparatorRow5() {
         assertThat(instance.compare(version("1.0.0-sp1"), version("2.0.0-sp1")), lessThan(0));
         assertThat(instance.compare(version("1.0.0-sp1"), version("1.1.0-sp1")), lessThan(0));
         assertThat(instance.compare(version("1.0.0-sp1"), version("1.0.1-sp1")), lessThan(0));
@@ -80,18 +80,18 @@ public abstract class VersionComparatorTestBase {
     }
 
     @Test
-    public void testVersionComparatorRow6() {
+    void testVersionComparatorRow6() {
         assertThat(instance.compare(version("foobar"), version("foobar-1")), lessThan(0));
     }
 
     @Test
-    public void testVersionComparatorRow7() {
+    void testVersionComparatorRow7() {
         assertThat(instance.compare(version("1-alpha-1"), version("2-alpha-1")), lessThan(0));
         assertThat(instance.compare(version("1-alpha-1"), version("1-alpha-2")), lessThan(0));
     }
 
     @Test
-    public void testBoundArtifactVersion() {
+    void testBoundArtifactVersion() {
         assertThat(
                 instance.compare(new BoundArtifactVersion("1.0.0", Segment.MAJOR), version("1.9.9")), greaterThan(0));
     }
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/recording/ChangeRecorderXMLTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/recording/ChangeRecorderXMLTest.java
index 63df10c2..8b76b80e 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/recording/ChangeRecorderXMLTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/recording/ChangeRecorderXMLTest.java
@@ -27,14 +27,16 @@ import java.nio.file.StandardCopyOption;
 
 import org.codehaus.mojo.versions.api.recording.ChangeRecorder;
 import org.codehaus.mojo.versions.api.recording.DependencyChangeRecord;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
-public final class ChangeRecorderXMLTest {
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+
+class ChangeRecorderXMLTest {
     private static void copyResource(final String name, final Path output) throws IOException {
         try (InputStream inputStream = ChangeRecorderXMLTest.class.getResourceAsStream(name)) {
             Files.copy(inputStream, output, StandardCopyOption.REPLACE_EXISTING);
@@ -48,7 +50,7 @@ public final class ChangeRecorderXMLTest {
     }
 
     @Test
-    public void testChanges() throws Exception {
+    void testChanges() throws Exception {
         final Path path0 = Files.createTempFile("ChangeRecorderTest", ".xml");
         final Path path1 = Files.createTempDirectory("ChangeRecorderTest")
                 .resolve("subDirectory")
@@ -81,39 +83,39 @@ public final class ChangeRecorderXMLTest {
         final NodeList elements0 = document0.getElementsByTagNameNS(ChangeRecorderXML.CHANGES_NAMESPACE, "updated");
         final NodeList elements1 = document1.getElementsByTagNameNS(ChangeRecorderXML.CHANGES_NAMESPACE, "updated");
 
-        Assert.assertEquals("Correct number of updates", elements0.getLength(), elements1.getLength());
+        assertEquals(elements0.getLength(), elements1.getLength(), "Correct number of updates");
 
         for (int index = 0; index < elements0.getLength(); ++index) {
             final Element element0 = (Element) elements0.item(index);
             final Element element1 = (Element) elements1.item(index);
 
-            Assert.assertEquals(
+            assertEquals(
                     element0.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "artifactId"),
                     element1.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "artifactId"));
-            Assert.assertEquals(
+            assertEquals(
                     element0.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "groupId"),
                     element1.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "groupId"));
-            Assert.assertEquals(
+            assertEquals(
                     element0.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "oldVersion"),
                     element1.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "oldVersion"));
-            Assert.assertEquals(
+            assertEquals(
                     element0.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "newVersion"),
                     element1.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "newVersion"));
 
             // FIXME - looks like assertions not working
-            Assert.assertEquals(
+            assertEquals(
                     element0.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "kind"),
                     element1.getAttributeNS(ChangeRecorderXML.CHANGES_NAMESPACE, "kind"));
         }
     }
 
     @Test
-    public void emptyResultShouldNotGenerateReports() throws Exception {
+    void emptyResultShouldNotGenerateReports() throws Exception {
         Path path = Files.createTempDirectory("ChangeRecorderTest").resolve("ChangeRecorderTest.xml");
 
         ChangeRecorder recorder = new ChangeRecorderXML();
         recorder.writeReport(path);
 
-        Assert.assertFalse("File should not be created", Files.isRegularFile(path));
+        assertFalse(Files.isRegularFile(path), "File should not be created");
     }
 }
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReaderTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReaderTest.java
index efe67876..3d259c01 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReaderTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/rewriting/ModifiedPomXMLEventReaderTest.java
@@ -22,17 +22,16 @@ package org.codehaus.mojo.versions.rewriting;
 import javax.xml.stream.Location;
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
 
 import java.io.StringReader;
+import java.lang.reflect.Field;
 
-import org.apache.maven.plugin.testing.AbstractMojoTestCase;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.Is.is;
@@ -44,8 +43,8 @@ import static org.mockito.Mockito.when;
  *
  * @author Andrzej Jarmoniuk
  */
-@RunWith(MockitoJUnitRunner.class)
-public class ModifiedPomXMLEventReaderTest extends AbstractMojoTestCase {
+@ExtendWith(MockitoExtension.class)
+class ModifiedPomXMLEventReaderTest {
     private static final String[] STR = {"xyz", "0123456789abcdef"};
     private static final String REPLACEMENT = "abcdef";
 
@@ -63,9 +62,8 @@ public class ModifiedPomXMLEventReaderTest extends AbstractMojoTestCase {
 
     private ModifiedPomXMLEventReader pomXMLEventReader;
 
-    @Before
-    public void setUp() throws Exception {
-        super.setUp();
+    @BeforeEach
+    void setUp() throws Exception {
 
         when(location.getCharacterOffset()).thenReturn(STR[0].length()).thenReturn(STR[0].length() + STR[1].length());
 
@@ -88,7 +86,7 @@ public class ModifiedPomXMLEventReaderTest extends AbstractMojoTestCase {
     }
 
     @Test
-    public void testReplace() throws XMLStreamException, IllegalAccessException {
+    void testReplace() throws Exception {
         assertThat(pomXMLEventReader.hasNext(), is(true));
         assertThat(pomXMLEventReader.nextEvent(), is(xmlEvent));
 
@@ -102,11 +100,13 @@ public class ModifiedPomXMLEventReaderTest extends AbstractMojoTestCase {
         assertThat(pomXMLEventReader.getMarkVerbatim(0), is(REPLACEMENT));
 
         // more dangerous test since this touches the implementation
-        assertThat(getVariableValueFromObject(pomXMLEventReader, "lastEnd"), is((STR[0] + REPLACEMENT).length()));
+        Field field = pomXMLEventReader.getClass().getDeclaredField("lastEnd");
+        field.setAccessible(true);
+        assertThat(field.getInt(pomXMLEventReader), is((STR[0] + REPLACEMENT).length()));
     }
 
     @Test
-    public void testReplaceMark() throws XMLStreamException, IllegalAccessException {
+    void testReplaceMark() throws Exception {
         assertThat(pomXMLEventReader.hasNext(), is(true));
         assertThat(pomXMLEventReader.nextEvent(), is(xmlEvent));
 
@@ -122,6 +122,9 @@ public class ModifiedPomXMLEventReaderTest extends AbstractMojoTestCase {
         assertThat(pomXMLEventReader.getMarkVerbatim(0), is(REPLACEMENT));
 
         // more dangerous test since this touches the implementation
-        assertThat(getVariableValueFromObject(pomXMLEventReader, "lastEnd"), is((STR[0] + REPLACEMENT).length()));
+        Field field = pomXMLEventReader.getClass().getDeclaredField("lastEnd");
+        field.setAccessible(true);
+
+        assertThat(field.getInt(pomXMLEventReader), is((STR[0] + REPLACEMENT).length()));
     }
 }
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/CoreExtensionUtilsTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/utils/CoreExtensionUtilsTest.java
index 90aaeec5..7af0c343 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/CoreExtensionUtilsTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/utils/CoreExtensionUtilsTest.java
@@ -25,7 +25,7 @@ import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Extension;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.hasItems;
@@ -38,10 +38,10 @@ import static org.mockito.Mockito.when;
  *
  * @author Andrzej Jarmoniuk
  */
-public class CoreExtensionUtilsTest {
+class CoreExtensionUtilsTest {
 
     @Test
-    public void testNoExtensions() throws XmlPullParserException, IOException {
+    void testNoExtensions() throws XmlPullParserException, IOException {
         MavenProject project = mock(MavenProject.class);
         when(project.getBasedir())
                 .thenReturn(
@@ -52,7 +52,7 @@ public class CoreExtensionUtilsTest {
     }
 
     @Test
-    public void testExtensionsFound() throws XmlPullParserException, IOException {
+    void testExtensionsFound() throws XmlPullParserException, IOException {
         MavenProject project = mock(MavenProject.class);
         when(project.getBasedir())
                 .thenReturn(new File("src/test/resources/org/codehaus/mojo/versions/utils/core-extensions"));
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/PropertiesVersionsFileReaderTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/utils/PropertiesVersionsFileReaderTest.java
index 5fd8c984..fc1e00d8 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/PropertiesVersionsFileReaderTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/utils/PropertiesVersionsFileReaderTest.java
@@ -25,23 +25,25 @@ import java.util.HashSet;
 import java.util.Set;
 
 import org.apache.commons.lang3.StringUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class PropertiesVersionsFileReaderTest {
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class PropertiesVersionsFileReaderTest {
 
     private static final String TEST_PROPERTIES_FILE =
             "src/test/resources/org/codehaus/mojo/versions/utils/testPropertiesVersionsFile.properties";
 
     @Test
-    public void testRead() throws IOException {
+    void testRead() throws IOException {
         PropertiesVersionsFileReader reader = new PropertiesVersionsFileReader(TEST_PROPERTIES_FILE);
         reader.read();
 
         int numberOfPropertiesConfig = 3;
-        Assert.assertTrue(equalsCvsUnordered(
+        assertTrue(equalsCvsUnordered(
                 "booking-api.version,booking-lib.version,be-air-impl.version", reader.getProperties()));
-        Assert.assertEquals(numberOfPropertiesConfig, reader.getPropertiesConfig().length);
+        assertEquals(numberOfPropertiesConfig, reader.getPropertiesConfig().length);
     }
 
     private boolean equalsCvsUnordered(String csvExpected, String csvActual) {
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/SegmentUtilsTest.java b/versions-common/src/test/java/org/codehaus/mojo/versions/utils/SegmentUtilsTest.java
index 36a8c17d..5ea5bf4e 100644
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/SegmentUtilsTest.java
+++ b/versions-common/src/test/java/org/codehaus/mojo/versions/utils/SegmentUtilsTest.java
@@ -22,7 +22,7 @@ import java.util.Optional;
 
 import org.apache.maven.plugin.logging.Log;
 import org.codehaus.mojo.versions.api.Segment;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static java.util.Optional.empty;
 import static java.util.Optional.of;
@@ -36,27 +36,27 @@ import static org.hamcrest.Matchers.is;
 /**
  * Unit tests for {@link SegmentUtils}
  */
-public class SegmentUtilsTest {
+class SegmentUtilsTest {
     @Test
-    public void testIncremental() {
+    void testIncremental() {
         assertThat(determineUnchangedSegment(false, false, false, null), is(of(INCREMENTAL)));
         assertThat(determineUnchangedSegment(true, false, false, null), is(of(INCREMENTAL)));
         assertThat(determineUnchangedSegment(true, true, false, null), is(of(INCREMENTAL)));
     }
 
     @Test
-    public void testMinor() {
+    void testMinor() {
         assertThat(determineUnchangedSegment(false, false, true, null), is(of(MINOR)));
         assertThat(determineUnchangedSegment(true, false, true, null), is(of(MINOR)));
     }
 
     @Test
-    public void testMajor() {
+    void testMajor() {
         assertThat(determineUnchangedSegment(false, true, true, null), is(of(MAJOR)));
     }
 
     @Test
-    public void testEmpty() {
+    void testEmpty() {
         Optional<Segment> result;
         boolean allowMinorUpdates = true;
         boolean allowIncrementalUpdates = true;
diff --git a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/VersionStub.java b/versions-common/src/test/java/org/codehaus/mojo/versions/utils/VersionStub.java
deleted file mode 100644
index c23e0575..00000000
--- a/versions-common/src/test/java/org/codehaus/mojo/versions/utils/VersionStub.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.codehaus.mojo.versions.utils;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.eclipse.aether.version.Version;
-
-/**
- * Stubs the {@link org.eclipse.aether.version.Version}
- */
-public class VersionStub implements Version {
-    private final String version;
-
-    /**
-     * Creates a new instance with the given version string
-     * @param version version to be set
-     */
-    public VersionStub(String version) {
-        assert version != null;
-        this.version = version;
-    }
-
-    @Override
-    public String toString() {
-        return version;
-    }
-
-    @Override
-    public int compareTo(Version o) {
-        return o != null ? version.compareTo(o.toString()) : 1;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-
-        if (!(o instanceof Version)) {
-            return false;
-        }
-
-        return version.equals(o.toString());
-    }
-
-    @Override
-    public int hashCode() {
-        return version.hashCode();
-    }
-}
diff --git a/versions-enforcer/src/test/java/org/codehaus/mojo/versions/enforcer/MaxDependencyUpdatesTest.java b/versions-enforcer/src/test/java/org/codehaus/mojo/versions/enforcer/MaxDependencyUpdatesTest.java
index d7219d2c..b20acbca 100644
--- a/versions-enforcer/src/test/java/org/codehaus/mojo/versions/enforcer/MaxDependencyUpdatesTest.java
+++ b/versions-enforcer/src/test/java/org/codehaus/mojo/versions/enforcer/MaxDependencyUpdatesTest.java
@@ -27,25 +27,24 @@ import org.apache.maven.project.MavenProject;
 import org.apache.maven.repository.RepositorySystem;
 import org.codehaus.mojo.versions.utils.DependencyBuilder;
 import org.codehaus.mojo.versions.utils.MockUtils;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.junit.jupiter.MockitoExtension;
 
 import static java.util.Arrays.asList;
 import static java.util.Collections.singletonList;
 import static java.util.Collections.singletonMap;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsString;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.Mockito.when;
 
-@RunWith(MockitoJUnitRunner.class)
-public class MaxDependencyUpdatesTest {
+@ExtendWith(MockitoExtension.class)
+class MaxDependencyUpdatesTest {
 
     @Mock
     private EnforcerLogger enforcerLogger;
@@ -65,14 +64,14 @@ public class MaxDependencyUpdatesTest {
     @InjectMocks
     private MaxDependencyUpdates maxDependencyUpdates;
 
-    @Before
+    @BeforeEach
     public void setup() {
         maxDependencyUpdates.setLog(enforcerLogger);
         MockUtils.prepareRepositorySystemMock(repositorySystem);
     }
 
     @Test
-    public void testRuleFailsByMaxUpdatesExceeded() throws ExpressionEvaluationException, ComponentLookupException {
+    void testRuleFailsByMaxUpdatesExceeded() {
         when(project.getDependencies())
                 .thenReturn(asList(
                         DependencyBuilder.newBuilder()
@@ -94,18 +93,13 @@ public class MaxDependencyUpdatesTest {
                     }
                 });
 
-        try {
-            maxDependencyUpdates.maxUpdates = 1;
-            maxDependencyUpdates.execute();
-
-            fail("EnforcerRuleException should have been thrown");
-        } catch (EnforcerRuleException e) {
-            assertThat(e.getMessage(), containsString("More than 1 upgradable artifacts detected"));
-        }
+        maxDependencyUpdates.maxUpdates = 1;
+        Exception e = assertThrows(EnforcerRuleException.class, () -> maxDependencyUpdates.execute());
+        assertThat(e.getMessage(), containsString("More than 1 upgradable artifacts detected"));
     }
 
     @Test
-    public void testRulePassesByMaxUpdatesNotExceeded() throws Exception {
+    void testRulePassesByMaxUpdatesNotExceeded() {
 
         when(project.getDependencies())
                 .thenReturn(singletonList(DependencyBuilder.newBuilder()
@@ -118,11 +112,11 @@ public class MaxDependencyUpdatesTest {
                 aetherRepositorySystem, singletonMap("artifactA", new String[] {"1.0.0", "2.0.0"}));
 
         maxDependencyUpdates.maxUpdates = 1;
-        maxDependencyUpdates.execute();
+        assertDoesNotThrow(() -> maxDependencyUpdates.execute());
     }
 
     @Test
-    public void testRulePassesByMaxUpdatesNotExceededDependencyIncludes() throws Exception {
+    void testRulePassesByMaxUpdatesNotExceededDependencyIncludes() {
 
         when(project.getDependencies())
                 .thenReturn(asList(
@@ -146,11 +140,11 @@ public class MaxDependencyUpdatesTest {
                 });
 
         maxDependencyUpdates.dependencyIncludes = singletonList("group:artifactB");
-        maxDependencyUpdates.execute();
+        assertDoesNotThrow(() -> maxDependencyUpdates.execute());
     }
 
     @Test
-    public void testRulePassesByMaxUpdatesNotExceededDependencyExcludes() throws Exception {
+    void testRulePassesByMaxUpdatesNotExceededDependencyExcludes() {
 
         when(project.getDependencies())
                 .thenReturn(asList(
@@ -174,11 +168,11 @@ public class MaxDependencyUpdatesTest {
                 });
 
         maxDependencyUpdates.dependencyExcludes = singletonList("group:artifactA");
-        maxDependencyUpdates.execute();
+        assertDoesNotThrow(() -> maxDependencyUpdates.execute());
     }
 
     @Test
-    public void testRulePassesByMaxUpdatesNotExceededDependencyIncludesExcludes() throws Exception {
+    void testRulePassesByMaxUpdatesNotExceededDependencyIncludesExcludes() {
 
         when(project.getDependencies())
                 .thenReturn(asList(
@@ -203,11 +197,11 @@ public class MaxDependencyUpdatesTest {
 
         maxDependencyUpdates.dependencyIncludes = singletonList("group:*");
         maxDependencyUpdates.dependencyExcludes = singletonList("group:artifactA");
-        maxDependencyUpdates.execute();
+        assertDoesNotThrow(() -> maxDependencyUpdates.execute());
     }
 
     @Test
-    public void testIgnoreSubIncrementalUpdates() throws Exception {
+    void testIgnoreSubIncrementalUpdates() {
 
         when(project.getDependencies())
                 .thenReturn(singletonList(DependencyBuilder.newBuilder()
@@ -220,11 +214,11 @@ public class MaxDependencyUpdatesTest {
                 aetherRepositorySystem, singletonMap("artifactA", new String[] {"1.0.0", "1.0.0-1"}));
 
         maxDependencyUpdates.ignoreSubIncrementalUpdates = true;
-        maxDependencyUpdates.execute();
+        assertDoesNotThrow(() -> maxDependencyUpdates.execute());
     }
 
     @Test
-    public void testIgnoreIncrementalUpdates() throws Exception {
+    void testIgnoreIncrementalUpdates() {
         when(project.getDependencies())
                 .thenReturn(singletonList(DependencyBuilder.newBuilder()
                         .withGroupId("group")
@@ -236,11 +230,11 @@ public class MaxDependencyUpdatesTest {
                 aetherRepositorySystem, singletonMap("artifactA", new String[] {"1.0.0", "1.0.0-1", "1.0.1"}));
 
         maxDependencyUpdates.ignoreIncrementalUpdates = true;
-        maxDependencyUpdates.execute();
+        assertDoesNotThrow(() -> maxDependencyUpdates.execute());
     }
 
     @Test
-    public void testIgnoreMinorUpdates() throws Exception {
+    void testIgnoreMinorUpdates() {
 
         when(project.getDependencies())
                 .thenReturn(singletonList(DependencyBuilder.newBuilder()
@@ -253,6 +247,6 @@ public class MaxDependencyUpdatesTest {
                 aetherRepositorySystem, singletonMap("artifactA", new String[] {"1.0.0", "1.0.0-1", "1.0.1", "1.1.0"}));
 
         maxDependencyUpdates.ignoreMinorUpdates = true;
-        maxDependencyUpdates.execute();
+        assertDoesNotThrow(() -> maxDependencyUpdates.execute());
     }
 }
diff --git a/versions-test/pom.xml b/versions-test/pom.xml
index ab4a0619..22e6de24 100644
--- a/versions-test/pom.xml
+++ b/versions-test/pom.xml
@@ -52,6 +52,10 @@
       <groupId>org.apache.maven.resolver</groupId>
       <artifactId>maven-resolver-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.resolver</groupId>
+      <artifactId>maven-resolver-util</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.maven.doxia</groupId>
       <artifactId>doxia-integration-tools</artifactId>
diff --git a/versions-test/src/main/java/org/codehaus/mojo/versions/utils/MockUtils.java b/versions-test/src/main/java/org/codehaus/mojo/versions/utils/MockUtils.java
index aea5a1d4..b8d248da 100644
--- a/versions-test/src/main/java/org/codehaus/mojo/versions/utils/MockUtils.java
+++ b/versions-test/src/main/java/org/codehaus/mojo/versions/utils/MockUtils.java
@@ -38,6 +38,8 @@ import org.eclipse.aether.resolution.ArtifactResult;
 import org.eclipse.aether.resolution.VersionRangeRequest;
 import org.eclipse.aether.resolution.VersionRangeResolutionException;
 import org.eclipse.aether.resolution.VersionRangeResult;
+import org.eclipse.aether.util.version.GenericVersionScheme;
+import org.eclipse.aether.version.InvalidVersionSpecificationException;
 import org.eclipse.aether.version.Version;
 
 import static java.util.Collections.emptyList;
@@ -108,7 +110,7 @@ public class MockUtils {
                                         e.getKey().equals(request.getArtifact().getArtifactId()))
                                 .findAny()
                                 .map(e -> Arrays.stream(e.getValue())
-                                        .map(VersionStub::new)
+                                        .map(MockUtils::parseVersion)
                                         .collect(() -> new ArrayList<Version>(), ArrayList::add, ArrayList::addAll))
                                 .map(versions -> new VersionRangeResult(request).setVersions(versions))
                                 .orElse(null); // should tell us if we haven't populated all cases in the test
@@ -118,6 +120,14 @@ public class MockUtils {
         }
     }
 
+    private static Version parseVersion(String version) {
+        try {
+            return new GenericVersionScheme().parseVersion(version);
+        } catch (InvalidVersionSpecificationException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
     public static I18N mockI18N() {
         I18N i18n = mock(I18N.class);
         when(i18n.getString(anyString(), any(), anyString())).thenAnswer(invocation -> invocation.getArgument(2));
diff --git a/versions-test/src/main/java/org/codehaus/mojo/versions/utils/VersionStub.java b/versions-test/src/main/java/org/codehaus/mojo/versions/utils/VersionStub.java
deleted file mode 100644
index 925d38fe..00000000
--- a/versions-test/src/main/java/org/codehaus/mojo/versions/utils/VersionStub.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.codehaus.mojo.versions.utils;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.eclipse.aether.version.Version;
-
-/**
- * Stubs the {@link Version}
- */
-public class VersionStub implements Version {
-    private final String version;
-
-    /**
-     * Creates a new instance with the given version string
-     * @param version version to be set
-     */
-    public VersionStub(String version) {
-        assert version != null;
-        this.version = version;
-    }
-
-    @Override
-    public String toString() {
-        return version;
-    }
-
-    @Override
-    public int compareTo(Version o) {
-        return o != null ? version.compareTo(o.toString()) : 1;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-
-        if (!(o instanceof Version)) {
-            return false;
-        }
-
-        return version.equals(o.toString());
-    }
-
-    @Override
-    public int hashCode() {
-        return version.hashCode();
-    }
-}