You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/12/23 10:43:46 UTC

[GitHub] [maven-resolver] michael-o opened a new pull request #83: [MRESOLVER-151] Enforce a checksum policy to be provided explicitly

michael-o opened a new pull request #83:
URL: https://github.com/apache/maven-resolver/pull/83


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] rfscholte commented on a change in pull request #83: [MRESOLVER-151] Enforce a checksum policy to be provided explicitly

Posted by GitBox <gi...@apache.org>.
rfscholte commented on a change in pull request #83:
URL: https://github.com/apache/maven-resolver/pull/83#discussion_r547974159



##########
File path: maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java
##########
@@ -124,7 +124,7 @@ public void testGetEffectiveChecksumPolicy_DifferentPolicies()
         }
     }
 
-    @Test
+    @Test( expected = IllegalArgumentException.class )

Review comment:
       With the change it'll exit with the first testcase and the first assert, making the rest useless.
   Better replace every `assertEquals` with something like
   
       IllegalArgumentException ex = assertThrows( IllegalArgumentException.class, () -> provider.getEffectiveChecksumPolicy(.....) );
       assertThat( ex.getMessage(), is(...))




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] michael-o commented on a change in pull request #83: [MRESOLVER-151] Enforce a checksum policy to be provided explicitly

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #83:
URL: https://github.com/apache/maven-resolver/pull/83#discussion_r548251877



##########
File path: maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java
##########
@@ -124,7 +124,7 @@ public void testGetEffectiveChecksumPolicy_DifferentPolicies()
         }
     }
 
-    @Test
+    @Test( expected = IllegalArgumentException.class )

Review comment:
       Yepp, that's true. Will change!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] rfscholte commented on a change in pull request #83: [MRESOLVER-151] Enforce a checksum policy to be provided explicitly

Posted by GitBox <gi...@apache.org>.
rfscholte commented on a change in pull request #83:
URL: https://github.com/apache/maven-resolver/pull/83#discussion_r548436414



##########
File path: maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java
##########
@@ -133,10 +135,12 @@ public void testGetEffectiveChecksumPolicy_UnknownPolicies()
                 { 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") );

Review comment:
       I didn't notice the static import of `assertThrows`, which is caused by an existing wildcard import. Please make imports explicit.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] michael-o commented on a change in pull request #83: [MRESOLVER-151] Enforce a checksum policy to be provided explicitly

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #83:
URL: https://github.com/apache/maven-resolver/pull/83#discussion_r548493269



##########
File path: maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java
##########
@@ -133,10 +135,12 @@ public void testGetEffectiveChecksumPolicy_UnknownPolicies()
                 { 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") );

Review comment:
       OK, all asserts where implicitly imported in this class. I will turn them into explicit ones.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] asfgit closed pull request #83: [MRESOLVER-151] Enforce a checksum policy to be provided explicitly

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #83:
URL: https://github.com/apache/maven-resolver/pull/83


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org