You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2024/03/03 19:29:58 UTC
(maven-gpg-plugin) branch master updated: [MGPG-107] Settle on JUnit 5 (#70)
This is an automated email from the ASF dual-hosted git repository.
cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 6081ad4 [MGPG-107] Settle on JUnit 5 (#70)
6081ad4 is described below
commit 6081ad4b94422d73ae90c8c8cc4eaa6ba99df5f5
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Sun Mar 3 20:29:53 2024 +0100
[MGPG-107] Settle on JUnit 5 (#70)
No need for another library just to perform 4 assertions.
---
https://issues.apache.org/jira/browse/MGPG-107
---
pgp-keys-map.list | 5 -----
pom.xml | 8 +-------
.../org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java | 14 +++++++++++---
.../apache/maven/plugins/gpg/it/GpgSignAttachedMojoIT.java | 13 ++++++-------
4 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/pgp-keys-map.list b/pgp-keys-map.list
index 2f4da1b..ddfa2c4 100644
--- a/pgp-keys-map.list
+++ b/pgp-keys-map.list
@@ -19,14 +19,9 @@ commons-io:commons-io = 0x2DB4F1EF0FA761ECC4EA935C86FDC7E2A11262CB
javax.inject:javax.inject = noSig
org.apiguardian:apiguardian-api = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
org.junit.jupiter:junit-jupiter-api = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
-org.junit.jupiter:junit-jupiter-engine = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
org.junit.jupiter:junit-jupiter-params = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
-org.junit.jupiter:junit-jupiter = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
org.junit.platform:junit-platform-commons = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
-org.junit.platform:junit-platform-engine = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
org.opentest4j:opentest4j = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
-net.bytebuddy:byte-buddy = 0xB4AC8CDC141AF0AE468D16921DA784CCB5C46DD5
-org.assertj:assertj-core = 0xBE685132AFD2740D9095F9040CC0B712FEE75827
org.apache.maven.resolver = 0x522CA055B326A636D833EF6A0551FD3684FCBBB7
org.apache.maven.shared:maven-invoker = 0x84789D24DF77A32433CE1F079EB80E92EB2135B1
org.codehaus.plexus:plexus-cipher = 0x6A814B1F869C2BBEAB7CB7271A2A1C94BDE89688
diff --git a/pom.xml b/pom.xml
index 1dd3e5a..c081058 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,15 +126,9 @@ under the License.
<version>2.0</version>
</dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <version>3.25.2</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
+ <artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
index e5374e6..f968332 100644
--- a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
+++ b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java
@@ -26,7 +26,9 @@ import org.apache.maven.shared.invoker.InvocationRequest;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
-import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class GpgSignArtifactIT {
private final File mavenHome;
@@ -80,7 +82,13 @@ public class GpgSignArtifactIT {
InvokerTestUtils.executeRequest(request, mavenHome, localRepository);
// then
- assertThat(expectedOutputDirectory).exists();
- assertThat(expectedOutputDirectory.list()).containsExactlyInAnyOrder(expectedFiles);
+ assertTrue(expectedOutputDirectory.isDirectory());
+
+ String[] outputFiles = expectedOutputDirectory.list();
+ assertNotNull(outputFiles);
+
+ Arrays.sort(outputFiles);
+ Arrays.sort(expectedFiles);
+ assertEquals(Arrays.toString(expectedFiles), Arrays.toString(outputFiles));
}
}
diff --git a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignAttachedMojoIT.java b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignAttachedMojoIT.java
index 3101b93..707ceeb 100644
--- a/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignAttachedMojoIT.java
+++ b/src/test/java/org/apache/maven/plugins/gpg/it/GpgSignAttachedMojoIT.java
@@ -25,7 +25,8 @@ import org.apache.maven.shared.invoker.InvocationResult;
import org.codehaus.plexus.util.FileUtils;
import org.junit.jupiter.api.Test;
-import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class GpgSignAttachedMojoIT {
@@ -58,11 +59,9 @@ public class GpgSignAttachedMojoIT {
final String buildLogContent = FileUtils.fileRead(result.getBuildLog());
// then
- assertThat(invocationResult.getExitCode())
- .as("Maven execution must fail")
- .isNotEqualTo(0);
- assertThat(buildLogContent)
- .as("Maven execution failed because no pinentry program is available")
- .contains("[GNUPG:] FAILURE sign 67108949");
+ assertNotEquals(0, invocationResult.getExitCode(), "Maven execution must fail");
+ assertTrue(
+ buildLogContent.contains("[GNUPG:] FAILURE sign 67108949"),
+ "Maven execution failed because no pinentry program is available");
}
}