You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/11/12 18:49:03 UTC

[GitHub] [commons-email] garydgregory commented on a diff in pull request #107: JUnit5 assertThrows DataSourceUrlResolverTest

garydgregory commented on code in PR #107:
URL: https://github.com/apache/commons-email/pull/107#discussion_r1020793402


##########
src/test/java/org/apache/commons/mail/resolver/DataSourceUrlResolverTest.java:
##########
@@ -81,13 +83,14 @@ public void testResolvingHttpLenientHost() throws Exception
      *
      * @throws Exception the test failed
      */
-    @Test(expected = IOException.class)
+    @Test
     public void testResolvingHttpNonLenient() throws Exception
     {
         final DataSourceResolver dataSourceResolver = new DataSourceUrlResolver(new URL("http://does.not.exist"), false);
         assertNotNull(dataSourceResolver.resolve("images/asf_logo_wide.gif"));
 
-        dataSourceResolver.resolve("images/does-not-exist.gif");
+        final Executable testMethod = () -> dataSourceResolver.resolve("images/does-not-exist.gif");
+        assertThrows(IOException.class, testMethod);

Review Comment:
   Hello @nhojpatrick 
   Thank you for your PR.
   As with the other PRs, the local variable is superfluous. 
   Please rebase on master to fix the spotbugs build on Java 11 and 17.



-- 
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@commons.apache.org

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