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 2022/08/31 07:14:27 UTC

[GitHub] [maven-verifier] gnodet commented on a diff in pull request #31: [MSHARED-1089] Upgrade maven-verifier to JDK 8 / Junit 5

gnodet commented on code in PR #31:
URL: https://github.com/apache/maven-verifier/pull/31#discussion_r959235724


##########
src/test/java/org/apache/maven/it/VerifierTest.java:
##########
@@ -105,19 +101,20 @@ public void testStripAnsi()
     @Test
     public void testLoadPropertiesFNFE() throws VerificationException
     {
-        exception.expectCause( isA( FileNotFoundException.class ) );
-
-        Verifier verifier = new Verifier( "src/test/resources" );
-        verifier.loadProperties( "unknown.properties" );
+        VerificationException exception = assertThrows( VerificationException.class, () -> {
+            Verifier verifier = new Verifier( "src/test/resources" );
+            verifier.loadProperties( "unknown.properties" );
+        } );
+        assertInstanceOf( FileNotFoundException.class, exception.getCause() );
     }
 
     @Test
     public void testDedicatedMavenHome() throws VerificationException, IOException
     {
         String mavenHome = Paths.get( "src/test/resources/maven-home" ).toAbsolutePath().toString();
-        Verifier verifier = new Verifier( temporaryFolder.getRoot().toString(), null, false, mavenHome );
+        Verifier verifier = new Verifier( temporaryFolder.toString(), null, false, mavenHome );

Review Comment:
   There are 10 different constructors, I'm not sure it's a good idea to add 10 more that would accept a `Path` instead of a `String` as the first parameter.



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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