This is an automated email from the ASF dual-hosted git repository. mthmulders pushed a commit to branch MGPG-44-gpg-sign-remove-target-prefix-in-output-directory in repository https://gitbox.apache.org/repos/asf/maven-gpg-plugin.git
commit 44d55021b9bcf2488809139890705ca14ec2aef3 Author: Giovanni van der Schelde <[email protected]> AuthorDate: Tue Sep 7 22:01:43 2021 +0200 [MGPG-44] Make it-test order agnostic Submitted by: Giovanni van der Schelde The integration test for the folder structure was flaky due to Files.list() returning the items in no particular order. --- .../java/org/apache/maven/plugins/gpg/it/GpgSignArtifactIT.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 19da0cb..704df50 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 @@ -29,6 +29,7 @@ import java.util.Arrays; import java.util.Collection; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.arrayContainingInAnyOrder; import static org.hamcrest.Matchers.equalTo; import static org.junit.runners.Parameterized.*; @@ -66,20 +67,20 @@ public class GpgSignArtifactIT public String[] expectedFiles; @Test - public void testFolderStructureWithArtifactAndDefaultOutputDirectory() throws Exception + public void testPlacementOfArtifactInOutputDirectory() throws Exception { // given final File pomFile = InvokerTestUtils.getTestResource( pomPath ); final InvocationRequest request = InvokerTestUtils.createRequest( pomFile, mavenUserSettings, gpgHome ); final File integrationTestRootDirectory = new File( pomFile.getParent()); - final File expectedOutputDirectory = new File (integrationTestRootDirectory + expectedFileLocation ); + final File expectedOutputDirectory = new File (integrationTestRootDirectory + expectedFileLocation ); // when InvokerTestUtils.executeRequest( request, mavenHome, localRepository ); // then assertThat( expectedOutputDirectory.exists(), equalTo( true ) ); - assertThat( expectedOutputDirectory.list(), equalTo( expectedFiles ) ); + assertThat( expectedOutputDirectory.list(), arrayContainingInAnyOrder( expectedFiles ) ); } }
