Skip to content

Commit 6081ad4

Browse files
authored
[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
1 parent 0b66b07 commit 6081ad4

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

pgp-keys-map.list

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,9 @@ commons-io:commons-io = 0x2DB4F1EF0FA761ECC4EA935C86FDC7E2A11262CB
1919
javax.inject:javax.inject = noSig
2020
org.apiguardian:apiguardian-api = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
2121
org.junit.jupiter:junit-jupiter-api = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
22-
org.junit.jupiter:junit-jupiter-engine = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
2322
org.junit.jupiter:junit-jupiter-params = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
24-
org.junit.jupiter:junit-jupiter = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
2523
org.junit.platform:junit-platform-commons = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
26-
org.junit.platform:junit-platform-engine = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
2724
org.opentest4j:opentest4j = 0xFF6E2C001948C5F2F38B0CC385911F425EC61B51
28-
net.bytebuddy:byte-buddy = 0xB4AC8CDC141AF0AE468D16921DA784CCB5C46DD5
29-
org.assertj:assertj-core = 0xBE685132AFD2740D9095F9040CC0B712FEE75827
3025
org.apache.maven.resolver = 0x522CA055B326A636D833EF6A0551FD3684FCBBB7
3126
org.apache.maven.shared:maven-invoker = 0x84789D24DF77A32433CE1F079EB80E92EB2135B1
3227
org.codehaus.plexus:plexus-cipher = 0x6A814B1F869C2BBEAB7CB7271A2A1C94BDE89688

pom.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,9 @@ under the License.
126126
<version>2.0</version>
127127
</dependency>
128128

129-
<dependency>
130-
<groupId>org.assertj</groupId>
131-
<artifactId>assertj-core</artifactId>
132-
<version>3.25.2</version>
133-
<scope>test</scope>
134-
</dependency>
135129
<dependency>
136130
<groupId>org.junit.jupiter</groupId>
137-
<artifactId>junit-jupiter</artifactId>
131+
<artifactId>junit-jupiter-api</artifactId>
138132
<scope>test</scope>
139133
</dependency>
140134
<dependency>

src/test/java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
import org.junit.jupiter.params.ParameterizedTest;
2727
import org.junit.jupiter.params.provider.MethodSource;
2828

29-
import static org.assertj.core.api.Assertions.assertThat;
29+
import static org.junit.jupiter.api.Assertions.assertEquals;
30+
import static org.junit.jupiter.api.Assertions.assertNotNull;
31+
import static org.junit.jupiter.api.Assertions.assertTrue;
3032

3133
public class GpgSignArtifactIT {
3234
private final File mavenHome;
@@ -80,7 +82,13 @@ void testPlacementOfArtifactInOutputDirectory(String pomPath, String expectedFil
8082
InvokerTestUtils.executeRequest(request, mavenHome, localRepository);
8183

8284
// then
83-
assertThat(expectedOutputDirectory).exists();
84-
assertThat(expectedOutputDirectory.list()).containsExactlyInAnyOrder(expectedFiles);
85+
assertTrue(expectedOutputDirectory.isDirectory());
86+
87+
String[] outputFiles = expectedOutputDirectory.list();
88+
assertNotNull(outputFiles);
89+
90+
Arrays.sort(outputFiles);
91+
Arrays.sort(expectedFiles);
92+
assertEquals(Arrays.toString(expectedFiles), Arrays.toString(outputFiles));
8593
}
8694
}

src/test/java/org/apache/maven/plugins/gpg/it/GpgSignAttachedMojoIT.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
import org.codehaus.plexus.util.FileUtils;
2626
import org.junit.jupiter.api.Test;
2727

28-
import static org.assertj.core.api.Assertions.assertThat;
28+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
29+
import static org.junit.jupiter.api.Assertions.assertTrue;
2930

3031
public class GpgSignAttachedMojoIT {
3132

@@ -58,11 +59,9 @@ void testInteractiveWithoutPassphrase() throws Exception {
5859
final String buildLogContent = FileUtils.fileRead(result.getBuildLog());
5960

6061
// then
61-
assertThat(invocationResult.getExitCode())
62-
.as("Maven execution must fail")
63-
.isNotEqualTo(0);
64-
assertThat(buildLogContent)
65-
.as("Maven execution failed because no pinentry program is available")
66-
.contains("[GNUPG:] FAILURE sign 67108949");
62+
assertNotEquals(0, invocationResult.getExitCode(), "Maven execution must fail");
63+
assertTrue(
64+
buildLogContent.contains("[GNUPG:] FAILURE sign 67108949"),
65+
"Maven execution failed because no pinentry program is available");
6766
}
6867
}

0 commit comments

Comments
 (0)