You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2020/12/23 22:15:38 UTC

[maven-resolver] branch MRSOLVER-151 updated: Fix

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch MRSOLVER-151
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git


The following commit(s) were added to refs/heads/MRSOLVER-151 by this push:
     new 2b9bdc6  Fix
2b9bdc6 is described below

commit 2b9bdc6cd1acdd1e6b7c6569364b1e28fcf4aa66
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Wed Dec 23 23:15:22 2020 +0100

    Fix
---
 .../internal/impl/DefaultChecksumPolicyProviderTest.java   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java
index 9a483fd..dbfd82e 100644
--- a/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java
+++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java
@@ -27,6 +27,8 @@ import org.eclipse.aether.repository.RemoteRepository;
 import org.eclipse.aether.repository.RepositoryPolicy;
 import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy;
 import org.eclipse.aether.transfer.TransferResource;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -124,7 +126,7 @@ public class DefaultChecksumPolicyProviderTest
         }
     }
 
-    @Test( expected = IllegalArgumentException.class )
+    @Test
     public void testGetEffectiveChecksumPolicy_UnknownPolicies()
     {
         String[][] testCases =
@@ -133,10 +135,12 @@ public class DefaultChecksumPolicyProviderTest
                 { RepositoryPolicy.CHECKSUM_POLICY_IGNORE, RepositoryPolicy.CHECKSUM_POLICY_IGNORE } };
         for ( String[] testCase : testCases )
         {
-            assertEquals( "unknown vs " + testCase[1], testCase[0],
-                          provider.getEffectiveChecksumPolicy( session, CHECKSUM_POLICY_UNKNOWN, testCase[1] ) );
-            assertEquals( "unknown vs " + testCase[1], testCase[0],
-                          provider.getEffectiveChecksumPolicy( session, testCase[1], CHECKSUM_POLICY_UNKNOWN ) );
+            IllegalArgumentException e = assertThrows( IllegalArgumentException.class,
+                    () -> provider.getEffectiveChecksumPolicy( session, CHECKSUM_POLICY_UNKNOWN, testCase[1] ) );
+            assertThat( e.getMessage(), is("Unsupported policy: unknown") );
+            e = assertThrows( IllegalArgumentException.class,
+                    () -> provider.getEffectiveChecksumPolicy( session, testCase[1], CHECKSUM_POLICY_UNKNOWN ) );
+            assertThat( e.getMessage(), is("Unsupported policy: unknown") );
         }
     }