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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-dependency-tree.git

commit d4913005cf64755e3c0310e771ce524935763b5c
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Wed Nov 25 22:56:17 2026 +0000

    Modernize Groovy IT scripts
    
    See https://github.com/apache/maven-invoker-plugin/issues/811.
---
 src/it/mshared-167/verify.groovy | 15 +++------------
 src/it/reactor/verify.groovy     | 15 ++++-----------
 2 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/src/it/mshared-167/verify.groovy b/src/it/mshared-167/verify.groovy
index 958b237..b7cc082 100644
--- a/src/it/mshared-167/verify.groovy
+++ b/src/it/mshared-167/verify.groovy
@@ -17,24 +17,15 @@
  * under the License.
  */
 
-import java.io.*;
-
-import org.codehaus.plexus.util.*;
-
 File outputFile = new File( basedir, "target/tree.txt" );
 File expectedFile = new File( basedir, "expected.txt" );
 
-String actual = FileUtils.fileRead( outputFile );
-String expected = FileUtils.fileRead( expectedFile );
+String actual = outputFile.getText( 'UTF-8' );
+String expected = expectedFile.getText( 'UTF-8' );
 
 actual = actual.replaceAll( "[\n\r]+", "\n" );
 expected = expected.replaceAll( "[\n\r]+", "\n" );
 
 System.out.println( "Checking dependency tree..." );
 
-if ( !actual.equals( expected ) )
-{
-    throw new Exception( "Unexpected dependency tree" );
-}
-
-return true;
+assert actual.equals( expected ) : "Unexpected dependency tree"
diff --git a/src/it/reactor/verify.groovy b/src/it/reactor/verify.groovy
index 845be14..5ae6fd5 100644
--- a/src/it/reactor/verify.groovy
+++ b/src/it/reactor/verify.groovy
@@ -17,23 +17,16 @@
  * under the License.
  */
 
-import java.io.*;
-
-import org.codehaus.plexus.util.*;
-
-String actual = FileUtils.fileRead( new File( basedir, 
"module-z-deps-y/target/tree.txt" ) );
-String expected = FileUtils.fileRead( new File( basedir, "expected-tree.txt" ) 
);
+String actual = new File( basedir, "module-z-deps-y/target/tree.txt" 
).getText( 'UTF-8' );
+String expected = new File( basedir, "expected-tree.txt" ).getText( 'UTF-8' );
 
 actual = actual.replaceAll( "[\n\r]+", "\n" );
 expected = expected.replaceAll( "[\n\r]+", "\n" );
 
 System.out.println( "Checking module-z-deps-y dependency tree..." );
 
-if ( !actual.equals( expected ) )
-{
-    throw new Exception( "Unexpected dependency tree" );
-}
+assert actual.equals( expected ) : "Unexpected dependency tree"
 
 File resolved = new File( basedir, "resolved-module-z-deps-y.txt" );
 
-return !resolved.exists();
+assert !resolved.exists()

Reply via email to