eric-milles commented on code in PR #115: URL: https://github.com/apache/ant-ivy/pull/115#discussion_r2342020248
########## test/java/org/apache/ivy/ant/IvyDependencyUpdateCheckerTest.java: ########## @@ -146,12 +142,10 @@ public void testFailure() { */ @Test public void testFailureWithMissingConfigurations() { - expExc.expect(BuildException.class); - expExc.expectMessage("unknown"); - dependencyUpdateChecker.setFile(new File("test/java/org/apache/ivy/ant/ivy-simple.xml")); dependencyUpdateChecker.setConf("default,unknown"); - dependencyUpdateChecker.execute(); + Exception exception = assertThrows(BuildException.class, () -> dependencyUpdateChecker.execute()); + assertEquals("requested configuration not found in apache#resolve-simple;1.0: [ 'unknown' ]", exception.getCause().getMessage()); Review Comment: This is the message on the cause exception. If you want to test the message on the top-level exception, it would need to be `assertTrue` ... `contains` or `endsWith` -- 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: dev-unsubscr...@ant.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org