Re: [PR] Java 8: use `assertThrows` instead of `Expe ctedException` rule [ant-ivy]

maartenc (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.ant.devel
Message-ID <PR_kwDOATT2Es6oExje-b57cff84-13c5-4431-98aa-1469089a8fc1@gitbox.apache.org>
maartenc commented on code in PR #115:
URL: https://github.com/apache/ant-ivy/pull/115#discussion_r2342348727


##########
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:
   ok, thanks for the clarification



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.