From 95deae6edd11ce8a59e59c795df4fdccdb1aeecc Mon Sep 17 00:00:00 2001
From: TheSnoozer <6849390+TheSnoozer@users.noreply.github.com>
Date: Mon, 18 Mar 2024 20:29:19 +0100
Subject: [PATCH]
https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/718:
replace junit:junit:4.13.2:test with
org.junit.jupiter:junit-jupiter-*:5.10.2:test
---
pom.xml | 25 +-
.../jgit/DescribeCommandIntegrationTest.java | 2 +-
.../core/jgit/DescribeResultTest.java | 6 +-
.../project13/maven/git/AheadBehindTest.java | 41 ++--
.../pl/project13/maven/git/BigDiffTest.java | 8 +-
.../git/GitCommitIdMojoIntegrationTest.java | 224 +++++++++---------
.../maven/git/GitCommitIdMojoTest.java | 16 +-
.../maven/git/GitIntegrationTest.java | 8 +-
.../maven/git/GitPropertiesFileTest.java | 11 +-
.../maven/git/GitSubmodulesTest.java | 15 +-
.../maven/git/NaivePerformanceTest.java | 18 +-
.../maven/git/NativeAndJGitProviderTest.java | 36 ++-
.../git/NativeProviderAheadBehindTest.java | 2 +-
.../maven/git/PropertiesFiltererTest.java | 24 +-
.../maven/git/PropertiesReplacerTest.java | 50 ++--
.../DescribeCommandAbbrevIntegrationTest.java | 2 +-
.../DescribeCommandTagsIntegrationTest.java | 6 +-
.../jgit/JgitProviderAheadBehindTest.java | 2 +-
.../maven/validation/ValidationMojoTest.java | 12 +-
19 files changed, 247 insertions(+), 261 deletions(-)
diff --git a/pom.xml b/pom.xml
index 53a6cddc..9ad2ad11 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,7 +52,7 @@
3.9.6
3.11.0
- 4.13.2
+ 5.10.2
5.10.0
3.25.3
@@ -320,8 +320,20 @@
- junit
- junit
+ org.junit.jupiter
+ junit-jupiter-api
+ ${junit.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${junit.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-params
${junit.version}
test
@@ -348,13 +360,6 @@
test
-
- pl.pragmatists
- JUnitParams
- 1.1.1
- test
-
-
org.slf4j
diff --git a/src/test/java/pl/project13/core/jgit/DescribeCommandIntegrationTest.java b/src/test/java/pl/project13/core/jgit/DescribeCommandIntegrationTest.java
index 1eb0153d..58560703 100644
--- a/src/test/java/pl/project13/core/jgit/DescribeCommandIntegrationTest.java
+++ b/src/test/java/pl/project13/core/jgit/DescribeCommandIntegrationTest.java
@@ -32,7 +32,7 @@
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import pl.project13.log.DummyTestLoggerBridge;
import pl.project13.maven.git.AvailableGitTestRepo;
import pl.project13.maven.git.GitIntegrationTest;
diff --git a/src/test/java/pl/project13/core/jgit/DescribeResultTest.java b/src/test/java/pl/project13/core/jgit/DescribeResultTest.java
index 112fee9c..45d2e391 100644
--- a/src/test/java/pl/project13/core/jgit/DescribeResultTest.java
+++ b/src/test/java/pl/project13/core/jgit/DescribeResultTest.java
@@ -25,8 +25,8 @@
import org.eclipse.jgit.api.ResetCommand;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import pl.project13.maven.git.AvailableGitTestRepo;
import pl.project13.maven.git.GitIntegrationTest;
@@ -45,7 +45,7 @@ public class DescribeResultTest extends GitIntegrationTest {
static final String DIRTY_MARKER = "-DEV";
@Override
- @Before
+ @BeforeEach
public void setUp() throws Exception {
super.setUp();
diff --git a/src/test/java/pl/project13/maven/git/AheadBehindTest.java b/src/test/java/pl/project13/maven/git/AheadBehindTest.java
index 877eef89..3ea8e885 100644
--- a/src/test/java/pl/project13/maven/git/AheadBehindTest.java
+++ b/src/test/java/pl/project13/maven/git/AheadBehindTest.java
@@ -18,17 +18,17 @@
package pl.project13.maven.git;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.File;
+import java.nio.file.Path;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.StoredConfig;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
import pl.project13.core.AheadBehind;
import pl.project13.core.GitProvider;
@@ -37,11 +37,14 @@
*/
public abstract class AheadBehindTest {
- @Rule public TemporaryFolder remoteRepository = new TemporaryFolder();
+ @TempDir
+ public Path remoteRepository;
- @Rule public TemporaryFolder localRepository = new TemporaryFolder();
+ @TempDir
+ public Path localRepository;
- @Rule public TemporaryFolder secondLocalRepository = new TemporaryFolder();
+ @TempDir
+ public Path secondLocalRepository;
protected Git localRepositoryGit;
@@ -49,7 +52,7 @@ public abstract class AheadBehindTest {
protected T gitProvider;
- @Before
+ @BeforeEach
public void setup() throws Exception {
createRemoteRepository();
@@ -65,7 +68,7 @@ public void setup() throws Exception {
extraSetup();
}
- @After
+ @AfterEach
public void tearDown() throws Exception {
if (localRepositoryGit != null) {
localRepositoryGit.close();
@@ -122,7 +125,7 @@ public void shouldBe1AheadAnd1Behind() throws Exception {
}
protected void createLocalCommit() throws Exception {
- File newFile = localRepository.newFile();
+ File newFile = localRepository.toFile();
localRepositoryGit.add().addFilepattern(newFile.getName()).call();
localRepositoryGit.commit().setMessage("ahead").call();
}
@@ -130,7 +133,7 @@ protected void createLocalCommit() throws Exception {
protected void createCommitInSecondRepoAndPush() throws Exception {
secondLocalRepositoryGit.pull().call();
- File newFile = secondLocalRepository.newFile();
+ File newFile = secondLocalRepository.toFile();
secondLocalRepositoryGit.add().addFilepattern(newFile.getName()).call();
secondLocalRepositoryGit.commit().setMessage("behind").call();
@@ -138,14 +141,14 @@ protected void createCommitInSecondRepoAndPush() throws Exception {
}
protected void createRemoteRepository() throws Exception {
- Git.init().setBare(true).setDirectory(remoteRepository.getRoot()).call();
+ Git.init().setBare(true).setDirectory(remoteRepository.toFile()).call();
}
protected void setupLocalRepository() throws Exception {
localRepositoryGit =
Git.cloneRepository()
- .setURI(remoteRepository.getRoot().toURI().toString())
- .setDirectory(localRepository.getRoot())
+ .setURI(remoteRepository.toFile().toURI().toString())
+ .setDirectory(localRepository.toFile())
.setBranch("master")
.call();
@@ -158,14 +161,14 @@ protected void setupLocalRepository() throws Exception {
protected void setupSecondLocalRepository() throws Exception {
secondLocalRepositoryGit =
Git.cloneRepository()
- .setURI(remoteRepository.getRoot().toURI().toString())
- .setDirectory(secondLocalRepository.getRoot())
+ .setURI(remoteRepository.toFile().toURI().toString())
+ .setDirectory(secondLocalRepository.toFile())
.setBranch("master")
.call();
}
protected void createAndPushInitialCommit() throws Exception {
- File newFile = localRepository.newFile();
+ File newFile = localRepository.toFile();
localRepositoryGit.add().addFilepattern(newFile.getName()).call();
localRepositoryGit.commit().setMessage("initial").call();
diff --git a/src/test/java/pl/project13/maven/git/BigDiffTest.java b/src/test/java/pl/project13/maven/git/BigDiffTest.java
index bdfaeb93..066ffaad 100644
--- a/src/test/java/pl/project13/maven/git/BigDiffTest.java
+++ b/src/test/java/pl/project13/maven/git/BigDiffTest.java
@@ -18,17 +18,12 @@
package pl.project13.maven.git;
-import static org.assertj.core.api.Assertions.assertThat;
-
import java.io.FileOutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.Properties;
-import junitparams.JUnitParamsRunner;
import org.apache.maven.project.MavenProject;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import pl.project13.core.git.GitDescribeConfig;
/**
@@ -38,7 +33,6 @@
*
* @author eternach
*/
-@RunWith(JUnitParamsRunner.class)
public class BigDiffTest extends GitIntegrationTest {
@Test
diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java
index a920620f..a6a10466 100644
--- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java
+++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoIntegrationTest.java
@@ -20,6 +20,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.when;
import java.io.File;
@@ -32,23 +33,20 @@
import java.util.Map;
import java.util.Properties;
import java.util.TimeZone;
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.ResetCommand;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import pl.project13.core.CommitIdPropertiesOutputFormat;
import pl.project13.core.git.GitDescribeConfig;
import pl.project13.core.util.GenericFileManager;
-@RunWith(JUnitParamsRunner.class)
public class GitCommitIdMojoIntegrationTest extends GitIntegrationTest {
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldIncludeExpectedProperties(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -68,8 +66,8 @@ public void shouldIncludeExpectedProperties(boolean useNativeGit) throws Excepti
assertGitPropertiesPresentInProject(properties);
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldExcludeAsConfiguredProperties(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -106,8 +104,8 @@ public void shouldExcludeAsConfiguredProperties(boolean useNativeGit) throws Exc
assertThat(properties).satisfies(new ContainsKeyCondition("git.commit.time"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldIncludeOnlyAsConfiguredProperties(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -145,8 +143,8 @@ public void shouldIncludeOnlyAsConfiguredProperties(boolean useNativeGit) throws
assertThat(properties).satisfies(new DoesNotContainKeyCondition("git.commit.time"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldExcludeAndIncludeAsConfiguredProperties(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -186,8 +184,8 @@ public void shouldExcludeAndIncludeAsConfiguredProperties(boolean useNativeGit)
assertThat(properties).satisfies(new DoesNotContainKeyCondition("git.commit.time"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldHaveNoPrefixWhenConfiguredPrefixIsEmptyStringAsConfiguredProperties(
boolean useNativeGit) throws Exception {
// given
@@ -213,8 +211,8 @@ public void shouldHaveNoPrefixWhenConfiguredPrefixIsEmptyStringAsConfiguredPrope
assertThat(properties).satisfies(new ContainsKeyCondition("remote.origin.url"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldSkipDescribeWhenConfiguredToDoSo(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -239,8 +237,8 @@ public void shouldSkipDescribeWhenConfiguredToDoSo(boolean useNativeGit) throws
.satisfies(new DoesNotContainKeyCondition("git.commit.id.describe"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldNotUseBuildEnvironmentBranchInfoWhenParameterSet(boolean useNativeGit)
throws Exception {
mavenSandbox
@@ -274,8 +272,8 @@ public void shouldNotUseBuildEnvironmentBranchInfoWhenParameterSet(boolean useNa
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.branch", "test_branch");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldUseJenkinsBranchInfoWhenAvailable(boolean useNativeGit) throws Exception {
// given
Map env = new HashMap<>();
@@ -358,8 +356,8 @@ private void shouldUseJenkinsBranchInfoWhenAvailableHelperAndAssertBranch(
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.branch", expectedBranchName);
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(boolean useNativeGit)
throws Exception {
// given
@@ -379,8 +377,8 @@ public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(boolean use
assertGitPropertiesPresentInProject(targetProject.getProperties());
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldNotRunWhenSkipIsSet(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -400,8 +398,8 @@ public void shouldNotRunWhenSkipIsSet(boolean useNativeGit) throws Exception {
assertThat(targetProject.getProperties()).isEmpty();
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldNotRunWhenPackagingPomAndDefaultSettingsApply(boolean useNativeGit)
throws Exception {
// given
@@ -421,8 +419,8 @@ public void shouldNotRunWhenPackagingPomAndDefaultSettingsApply(boolean useNativ
assertThat(targetProject.getProperties()).isEmpty();
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldRunWhenPackagingPomAndSkipPomsFalse(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -442,8 +440,8 @@ public void shouldRunWhenPackagingPomAndSkipPomsFalse(boolean useNativeGit) thro
assertThat(targetProject.getProperties()).isNotEmpty();
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldUseParentProjectRepoWhenInvokedFromChild(boolean useNativeGit)
throws Exception {
// given
@@ -464,8 +462,8 @@ public void shouldUseParentProjectRepoWhenInvokedFromChild(boolean useNativeGit)
assertGitPropertiesPresentInProject(targetProject.getProperties());
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldUseChildProjectRepoIfInvokedFromChild(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -485,8 +483,8 @@ public void shouldUseChildProjectRepoIfInvokedFromChild(boolean useNativeGit) th
assertGitPropertiesPresentInProject(targetProject.getProperties());
}
- @Test(expected = MojoExecutionException.class)
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldFailWithExceptionWhenNoGitRepoFound(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -499,11 +497,13 @@ public void shouldFailWithExceptionWhenNoGitRepoFound(boolean useNativeGit) thro
mojo.skipPoms = false;
mojo.useNativeGit = useNativeGit;
- mojo.execute();
+ assertThrows(MojoExecutionException.class, () -> {
+ mojo.execute();
+ });
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateCustomPropertiesFileProperties(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -532,8 +532,8 @@ public void shouldGenerateCustomPropertiesFileProperties(boolean useNativeGit) t
}
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateCustomPropertiesFileJson(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -566,8 +566,8 @@ public void shouldGenerateCustomPropertiesFileJson(boolean useNativeGit) throws
}
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldSkipWithoutFailOnNoGitDirectoryWhenNoGitRepoFound(boolean useNativeGit)
throws Exception {
// given
@@ -589,8 +589,8 @@ public void shouldSkipWithoutFailOnNoGitDirectoryWhenNoGitRepoFound(boolean useN
"git.build.time", "git.build.version", "git.build.host");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldNotSkipWithoutFailOnNoGitDirectoryWhenNoGitRepoIsPresent(boolean useNativeGit)
throws Exception {
// given
@@ -611,8 +611,8 @@ public void shouldNotSkipWithoutFailOnNoGitDirectoryWhenNoGitRepoIsPresent(boole
assertGitPropertiesPresentInProject(targetProject.getProperties());
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateDescribeWithTagOnlyWhenForceLongFormatIsFalse(boolean useNativeGit)
throws Exception {
// given
@@ -638,8 +638,8 @@ public void shouldGenerateDescribeWithTagOnlyWhenForceLongFormatIsFalse(boolean
targetProject.getProperties(), "git.commit.id.describe", "v1.0.0-dirty");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void
shouldGenerateDescribeWithTagOnlyWhenForceLongFormatIsFalseAndAbbrevLengthIsNonDefault(
boolean useNativeGit) throws Exception {
@@ -667,8 +667,8 @@ public void shouldGenerateDescribeWithTagOnlyWhenForceLongFormatIsFalse(boolean
targetProject.getProperties(), "git.commit.id.describe-short", "v1.0.0");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateDescribeWithTagAndZeroAndCommitIdWhenForceLongFormatIsTrue(
boolean useNativeGit) throws Exception {
// given
@@ -692,8 +692,8 @@ public void shouldGenerateDescribeWithTagAndZeroAndCommitIdWhenForceLongFormatIs
targetProject.getProperties(), "git.commit.id.describe", "v1.0.0-0-gde4db35");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void
shouldGenerateDescribeWithTagAndZeroAndCommitIdWhenForceLongFormatIsTrueAndAbbrevLengthIsNonDefault(
boolean useNativeGit) throws Exception {
@@ -721,8 +721,8 @@ public void shouldGenerateDescribeWithTagAndZeroAndCommitIdWhenForceLongFormatIs
targetProject.getProperties(), "git.commit.id.describe-short", "v1.0.0-0");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateCommitIdAbbrevWithDefaultLength(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -743,8 +743,8 @@ public void shouldGenerateCommitIdAbbrevWithDefaultLength(boolean useNativeGit)
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.commit.id.abbrev", "de4db35");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateCommitIdAbbrevWithNonDefaultLength(boolean useNativeGit)
throws Exception {
// given
@@ -766,8 +766,8 @@ public void shouldGenerateCommitIdAbbrevWithNonDefaultLength(boolean useNativeGi
assertThat(targetProject.getProperties()).contains(entry("git.commit.id.abbrev", "de4db35917"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldFormatDate(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -794,8 +794,8 @@ public void shouldFormatDate(boolean useNativeGit) throws Exception {
assertThat(targetProject.getProperties()).contains(entry("git.commit.time", "08/19/2012"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldSkipGitDescribe(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -820,8 +820,8 @@ public void shouldSkipGitDescribe(boolean useNativeGit) throws Exception {
.satisfies(new DoesNotContainKeyCondition("git.commit.id.describe"));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldMarkGitDescribeAsDirty(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -847,8 +847,8 @@ public void shouldMarkGitDescribeAsDirty(boolean useNativeGit) throws Exception
.contains(entry("git.commit.id.describe", "v1.0.0-0-gde4db35" + dirtySuffix));
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldAlwaysPrintGitDescribe(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -873,8 +873,8 @@ public void shouldAlwaysPrintGitDescribe(boolean useNativeGit) throws Exception
targetProject.getProperties(), "git.commit.id.describe", "0b0181b");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldWorkWithEmptyGitDescribe(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -897,8 +897,8 @@ public void shouldWorkWithEmptyGitDescribe(boolean useNativeGit) throws Exceptio
assertGitPropertiesPresentInProject(targetProject.getProperties());
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldWorkWithNullGitDescribe(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -920,8 +920,8 @@ public void shouldWorkWithNullGitDescribe(boolean useNativeGit) throws Exception
assertGitPropertiesPresentInProject(targetProject.getProperties());
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldExtractTagsOnGivenCommit(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -955,8 +955,8 @@ public void shouldExtractTagsOnGivenCommit(boolean useNativeGit) throws Exceptio
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.total.commit.count", "2");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldExtractTagsOnGivenCommitWithOldestCommit(boolean useNativeGit)
throws Exception {
// given
@@ -991,8 +991,8 @@ public void shouldExtractTagsOnGivenCommitWithOldestCommit(boolean useNativeGit)
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.total.commit.count", "1");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldExtractTagsOnHead(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1021,8 +1021,8 @@ public void shouldExtractTagsOnHead(boolean useNativeGit) throws Exception {
.containsOnly("v1.0.0");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void runGitDescribeWithMatchOption(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1069,8 +1069,8 @@ public void runGitDescribeWithMatchOption(boolean useNativeGit) throws Exception
}
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateClosestTagInformationWhenOnATag(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1097,8 +1097,8 @@ public void shouldGenerateClosestTagInformationWhenOnATag(boolean useNativeGit)
targetProject.getProperties(), "git.closest.tag.commit.count", "0");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateClosestTagInformationWhenOnATagAndDirty(boolean useNativeGit)
throws Exception {
// given
@@ -1127,8 +1127,8 @@ public void shouldGenerateClosestTagInformationWhenOnATagAndDirty(boolean useNat
targetProject.getProperties(), "git.closest.tag.commit.count", "0");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateClosestTagInformationWhenCommitHasTwoTags(boolean useNativeGit)
throws Exception {
// given
@@ -1161,8 +1161,8 @@ public void shouldGenerateClosestTagInformationWhenCommitHasTwoTags(boolean useN
targetProject.getProperties(), "git.closest.tag.commit.count", "0");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldUseDateFormatTimeZone(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1205,8 +1205,8 @@ public void shouldUseDateFormatTimeZone(boolean useNativeGit) throws Exception {
TimeZone.setDefault(currentDefaultTimeZone);
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateCommitIdOldFashioned(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1230,8 +1230,8 @@ public void shouldGenerateCommitIdOldFashioned(boolean useNativeGit) throws Exce
assertThat(properties.stringPropertyNames()).doesNotContain("git.commit.id.full");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void testDetectCleanWorkingDirectory(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1261,8 +1261,8 @@ public void testDetectCleanWorkingDirectory(boolean useNativeGit) throws Excepti
.contains(entry("git.commit.id.describe", "85c2888")); // assert no dirtySuffix at the end!
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void testDetectDirtyWorkingDirectory(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1295,8 +1295,8 @@ public void testDetectDirtyWorkingDirectory(boolean useNativeGit) throws Excepti
"0b0181b" + dirtySuffix)); // assert dirtySuffix at the end!
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateClosestTagInformationWithExcludeLightweightTagsForClosestTag(
boolean useNativeGit) throws Exception {
// given
@@ -1335,8 +1335,8 @@ public void shouldGenerateClosestTagInformationWithExcludeLightweightTagsForClos
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.total.commit.count", "3");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateClosestTagInformationWithIncludeLightweightTagsForClosestTag(
boolean useNativeGit) throws Exception {
// given
@@ -1373,8 +1373,8 @@ public void shouldGenerateClosestTagInformationWithIncludeLightweightTagsForClos
targetProject.getProperties(), "git.closest.tag.commit.count", "1");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void
shouldGenerateClosestTagInformationWithIncludeLightweightTagsForClosestTagAndPreferAnnotatedTags(
boolean useNativeGit) throws Exception {
@@ -1412,8 +1412,8 @@ public void shouldGenerateClosestTagInformationWithIncludeLightweightTagsForClos
targetProject.getProperties(), "git.closest.tag.commit.count", "1");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGenerateClosestTagInformationWithIncludeLightweightTagsForClosestTagAndFilter(
boolean useNativeGit) throws Exception {
// given
@@ -1451,8 +1451,8 @@ public void shouldGenerateClosestTagInformationWithIncludeLightweightTagsForClos
targetProject.getProperties(), "git.closest.tag.commit.count", "1");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void verifyEvalOnDifferentCommitWithParentOfHead(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1484,8 +1484,8 @@ public void verifyEvalOnDifferentCommitWithParentOfHead(boolean useNativeGit) th
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.dirty", "true");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void verifyEvalOnDifferentCommitWithBranchName(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1521,8 +1521,8 @@ public void verifyEvalOnDifferentCommitWithBranchName(boolean useNativeGit) thro
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.total.commit.count", "2");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void verifyEvalOnDifferentCommitWithTagName(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1559,8 +1559,8 @@ public void verifyEvalOnDifferentCommitWithTagName(boolean useNativeGit) throws
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.total.commit.count", "2");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void verifyEvalOnDifferentCommitWithCommitHash(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1596,8 +1596,8 @@ public void verifyEvalOnDifferentCommitWithCommitHash(boolean useNativeGit) thro
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.total.commit.count", "2");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void verifyEvalOnCommitWithTwoBranches(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1628,8 +1628,8 @@ public void verifyEvalOnCommitWithTwoBranches(boolean useNativeGit) throws Excep
targetProject.getProperties(), "git.branch", "another_branch,master,z_branch");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void verifyDetachedHeadIsNotReportedAsBranch(boolean useNativeGit) throws Exception {
// given
mavenSandbox
@@ -1656,8 +1656,8 @@ public void verifyDetachedHeadIsNotReportedAsBranch(boolean useNativeGit) throws
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.branch", "master");
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGeneratePropertiesWithMultiplePrefixesAndReactorProject(boolean useNativeGit)
throws Exception {
// given
diff --git a/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java b/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java
index 0686dfad..7a2be13c 100644
--- a/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java
+++ b/src/test/java/pl/project13/maven/git/GitCommitIdMojoTest.java
@@ -22,19 +22,15 @@
import java.io.File;
import java.io.IOException;
-import java.time.Instant;
import java.util.Date;
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
-import org.joda.time.DateTime;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import pl.project13.core.PropertiesFileGenerator;
/**
* Testcases to verify that the git-commit-id works properly.
*/
-@RunWith(JUnitParamsRunner.class)
public class GitCommitIdMojoTest {
@Test
public void testCraftPropertiesOutputFileWithRelativePath() throws IOException {
@@ -86,7 +82,7 @@ public void testCraftPropertiesOutputFileWithFullPath() throws IOException {
* extended format (e.g. 2024-02-15T13:54:59+01:00).
* The maven plugin only supports the extended format.
*/
- private Object[] parametersParseOutputTimestamp() {
+ private static Object[] parametersParseOutputTimestamp() {
return new Object[] {
// long since epoch
new Object[] {
@@ -129,8 +125,8 @@ private Object[] parametersParseOutputTimestamp() {
};
}
- @Test
- @Parameters(method = "parametersParseOutputTimestamp")
+ @ParameterizedTest
+ @MethodSource("parametersParseOutputTimestamp")
public void testParseOutputTimestamp(String input) {
Date actual = GitCommitIdMojo.parseOutputTimestamp(input);
assertThat(actual).isNotNull();
diff --git a/src/test/java/pl/project13/maven/git/GitIntegrationTest.java b/src/test/java/pl/project13/maven/git/GitIntegrationTest.java
index 8452307b..b85e0a6a 100644
--- a/src/test/java/pl/project13/maven/git/GitIntegrationTest.java
+++ b/src/test/java/pl/project13/maven/git/GitIntegrationTest.java
@@ -38,8 +38,8 @@
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
import org.eclipse.jgit.api.Git;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
import pl.project13.core.CommitIdPropertiesOutputFormat;
/**
@@ -63,7 +63,7 @@ public static Collection> useNativeGit() {
protected GitCommitIdMojo mojo;
protected FileSystemMavenSandbox mavenSandbox;
- @Before
+ @BeforeEach
public void setUp() throws Exception {
// generate unique sandbox for this test
File sandbox;
@@ -80,7 +80,7 @@ public void setUp() throws Exception {
initializeMojoWithDefaults(mojo);
}
- @After
+ @AfterEach
public void tearDown() throws Exception {
final boolean keep = mavenSandbox != null && mavenSandbox.isKeepSandboxWhenFinishedTest();
diff --git a/src/test/java/pl/project13/maven/git/GitPropertiesFileTest.java b/src/test/java/pl/project13/maven/git/GitPropertiesFileTest.java
index f0c0af15..29fc696d 100644
--- a/src/test/java/pl/project13/maven/git/GitPropertiesFileTest.java
+++ b/src/test/java/pl/project13/maven/git/GitPropertiesFileTest.java
@@ -25,19 +25,16 @@
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Properties;
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.FileUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import pl.project13.core.CommitIdPropertiesOutputFormat;
import pl.project13.core.util.GenericFileManager;
/**
* Testcases to verify that the git-commit-id works properly.
*/
-@RunWith(JUnitParamsRunner.class)
public class GitPropertiesFileTest extends GitIntegrationTest {
static final boolean USE_JGIT = false;
@@ -47,8 +44,8 @@ public static Collection> useNativeGit() {
return asList(USE_JGIT, USE_NATIVE_GIT);
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldConformPropertiesFileWhenSpecialCharactersInValueString(boolean useNativeGit)
throws Exception {
// given
diff --git a/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java b/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java
index 3fb15306..eb351f3f 100644
--- a/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java
+++ b/src/test/java/pl/project13/maven/git/GitSubmodulesTest.java
@@ -19,20 +19,17 @@
package pl.project13.maven.git;
import java.nio.file.Files;
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
import org.apache.maven.project.MavenProject;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
/**
* Testcases to verify that the git-commit-id-plugin works properly.
*/
-@RunWith(JUnitParamsRunner.class)
public class GitSubmodulesTest extends GitIntegrationTest {
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(
boolean useNativeGit) throws Exception {
mavenSandbox
@@ -52,8 +49,8 @@ public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(
assertGitPropertiesPresentInProject(targetProject.getProperties());
}
- @Test
- @Parameters(method = "useNativeGit")
+ @ParameterizedTest
+ @MethodSource("useNativeGit")
public void shouldGeneratePropertiesWithSubmodules(boolean useNativeGit) throws Exception {
// given
mavenSandbox
diff --git a/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java b/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java
index 802d62e9..0dfe71ea 100644
--- a/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java
+++ b/src/test/java/pl/project13/maven/git/NaivePerformanceTest.java
@@ -18,23 +18,17 @@
package pl.project13.maven.git;
-import static org.assertj.core.api.Assertions.assertThat;
-
import java.util.Arrays;
import java.util.Collection;
-import java.util.Properties;
-import junitparams.JUnitParamsRunner;
-import junitparams.Parameters;
import org.apache.maven.project.MavenProject;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import pl.project13.core.git.GitDescribeConfig;
/**
* Testcases to verify that the git-commit-id works properly.
*/
-@RunWith(JUnitParamsRunner.class)
public class NaivePerformanceTest extends GitIntegrationTest {
static final boolean UseJGit = false;
@@ -50,9 +44,9 @@ public static Collection> performanceParameter() {
});
}
- @Test
- @Parameters(method = "performanceParameter")
- @Ignore("Naive performance test - run this locally")
+ @ParameterizedTest
+ @MethodSource("performanceParameter")
+ @Disabled("Naive performance test - run this locally")
public void performance(boolean useNativeGit, int iterations) throws Exception {
// given
mavenSandbox
diff --git a/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java b/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java
index 4c35a98c..1e882c44 100644
--- a/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java
+++ b/src/test/java/pl/project13/maven/git/NativeAndJGitProviderTest.java
@@ -18,15 +18,12 @@
package pl.project13.maven.git;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Properties;
import org.apache.maven.project.MavenProject;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
import pl.project13.core.jgit.DescribeResult;
/**
@@ -148,24 +145,24 @@ private void verifyNativeAndJGit(
// git.build.time is excused because the two runs happened at different times.
String jGitKey = jgitProps.getProperty(key);
String nativeKey = nativeProps.getProperty(key);
- assertEquals(
- "Key difference for key: '" + key + "'; jgit=" + jGitKey
- + "; nativeKey=" + nativeKey + "; for " + repo.getDir(),
+ Assertions.assertEquals(
jGitKey,
- nativeKey);
+ nativeKey,
+ "Key difference for key: '" + key + "'; jgit=" + jGitKey
+ + "; nativeKey=" + nativeKey + "; for " + repo.getDir());
} else {
// Ensure that the date formats are parseable and within reason. If running all the git
// commands on the
// native provider takes more than 60 seconds, then something is seriously wrong.
long jGitBuildTimeInMs = format.parse(jgitProps.getProperty(key)).getTime();
long nativeBuildTimeInMs = format.parse(nativeProps.getProperty(key)).getTime();
- Assert.assertTrue(
- "Time ran backwards, jgitTime after nativeTime!",
- jGitBuildTimeInMs <= nativeBuildTimeInMs);
- Assert.assertTrue(
- "Build ran too slow.",
- (nativeBuildTimeInMs - jGitBuildTimeInMs)
- < 60000L); // If native takes more than 1 minute, something is wrong.
+ Assertions.assertTrue(
+ jGitBuildTimeInMs <= nativeBuildTimeInMs,
+ "Time ran backwards, jgitTime after nativeTime!");
+ // If native takes more than 1 minute, something is wrong.
+ Assertions.assertTrue(
+ (nativeBuildTimeInMs - jGitBuildTimeInMs) < 60000L,
+ "Build ran too slow.");
}
}
@@ -173,9 +170,10 @@ private void verifyNativeAndJGit(
long jGitCommitTimeInMs = format.parse(jgitProps.getProperty("git.commit.time")).getTime();
long nativeCommitTimeInMs = format.parse(nativeProps.getProperty("git.commit.time")).getTime();
- assertEquals(
- "commit times parse to different time stamps",
- jGitCommitTimeInMs, nativeCommitTimeInMs);
+ Assertions.assertEquals(
+ jGitCommitTimeInMs,
+ nativeCommitTimeInMs,
+ "commit times parse to different time stamps");
}
private Properties createCopy(Properties orig) {
diff --git a/src/test/java/pl/project13/maven/git/NativeProviderAheadBehindTest.java b/src/test/java/pl/project13/maven/git/NativeProviderAheadBehindTest.java
index 9bbf05b3..0a135b7c 100644
--- a/src/test/java/pl/project13/maven/git/NativeProviderAheadBehindTest.java
+++ b/src/test/java/pl/project13/maven/git/NativeProviderAheadBehindTest.java
@@ -24,7 +24,7 @@ public class NativeProviderAheadBehindTest extends AheadBehindTest useRegexReplacement() {
return asList(true, false);
@@ -51,7 +49,7 @@ public static Collection> useRegexReplacement() {
private PropertiesReplacer propertiesReplacer;
- @Before
+ @BeforeEach
public void setUp() throws Throwable {
PluginParameterExpressionEvaluator pluginParameterExpressionEvaluator =
mock(PluginParameterExpressionEvaluator.class);
@@ -67,8 +65,8 @@ public void testPerformReplacementWithNullValues() throws IOException {
propertiesReplacer.performReplacement(properties, replacementProperties);
}
- @Test
- @Parameters(method = "useRegexReplacement")
+ @ParameterizedTest
+ @MethodSource("useRegexReplacement")
public void testPerformReplacementWithInvalidReplacement(boolean regex) throws IOException {
Properties actualProperties = build("key1", "value1", "key2", "value2");
@@ -79,8 +77,8 @@ public void testPerformReplacementWithInvalidReplacement(boolean regex) throws I
propertiesReplacer.performReplacement(actualProperties, replacementProperties);
}
- @Test
- @Parameters(method = "useRegexReplacement")
+ @ParameterizedTest
+ @MethodSource("useRegexReplacement")
public void testPerformReplacementWithSingleProperty(boolean regex) throws IOException {
Properties actualProperties = build("key1", "value1", "key2", "value2");
@@ -94,8 +92,8 @@ public void testPerformReplacementWithSingleProperty(boolean regex) throws IOExc
assertEquals(exptecedProperties, actualProperties);
}
- @Test
- @Parameters(method = "useRegexReplacement")
+ @ParameterizedTest
+ @MethodSource("useRegexReplacement")
public void testPerformReplacementWithSinglePropertyEmptyValue(boolean regex) throws IOException {
Properties actualProperties = build("key1", "value1", "key2", "value2");
@@ -109,8 +107,8 @@ public void testPerformReplacementWithSinglePropertyEmptyValue(boolean regex) th
assertEquals(exptecedProperties, actualProperties);
}
- @Test
- @Parameters(method = "useRegexReplacement")
+ @ParameterizedTest
+ @MethodSource("useRegexReplacement")
public void testPerformReplacementWithMultipleProperties(boolean regex) throws IOException {
Properties actualProperties = build("key1", "value1", "key2", "value2");
@@ -124,8 +122,8 @@ public void testPerformReplacementWithMultipleProperties(boolean regex) throws I
assertEquals(exptecedProperties, actualProperties);
}
- @Test
- @Parameters(method = "useRegexReplacement")
+ @ParameterizedTest
+ @MethodSource("useRegexReplacement")
public void testPerformReplacementWithMultiplePropertiesEmptyValue(boolean regex)
throws IOException {
Properties actualProperties = build("key1", "value1", "key2", "value2");
@@ -256,8 +254,8 @@ public static Collection