garydgregory commented on code in PR #12:
URL: https://github.com/apache/commons-weaver/pull/12#discussion_r1026567810


##########
processor/src/test/java/org/apache/commons/weaver/utils/ProvidersTest.java:
##########
@@ -29,17 +30,20 @@
 import org.apache.commons.weaver.spi.Weaver;
 import org.hamcrest.collection.IsIterableContainingInOrder;
 import org.junit.Test;
+import org.junit.jupiter.api.function.Executable;
 
 public class ProvidersTest {
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void testSortNull() {
-        Providers.sort(null);
+        final Executable testMethod = () -> Providers.sort(null);
+        assertThrows(NullPointerException.class, testMethod);

Review Comment:
   Hi @nhojpatrick 
   Please remove the local variable.



##########
processor/src/test/java/org/apache/commons/weaver/utils/ProvidersTest.java:
##########
@@ -85,9 +89,10 @@ public void testSort() {
         assertThat(Providers.sort(Arrays.asList(y, w, x, z)), 
IsIterableContainingInOrder.contains(z, y, x, w));
     }
 
-    @Test(expected = IllegalStateException.class)
+    @Test
     public void testCircularSort() {
-        Providers.sort(Arrays.asList(y, z, monkeywrench));
+        final Executable testMethod = () -> Providers.sort(Arrays.asList(y, z, 
monkeywrench));

Review Comment:
   Hi @nhojpatrick 
   Please remove the local variable.



##########
processor/src/test/java/org/apache/commons/weaver/utils/ProvidersTest.java:
##########
@@ -29,17 +30,20 @@
 import org.apache.commons.weaver.spi.Weaver;
 import org.hamcrest.collection.IsIterableContainingInOrder;
 import org.junit.Test;
+import org.junit.jupiter.api.function.Executable;
 
 public class ProvidersTest {
 
-    @Test(expected = NullPointerException.class)
+    @Test
     public void testSortNull() {
-        Providers.sort(null);
+        final Executable testMethod = () -> Providers.sort(null);
+        assertThrows(NullPointerException.class, testMethod);
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testSortNullElement() {
-        Providers.sort(Arrays.asList((Weaver) null));
+        final Executable testMethod = () -> 
Providers.sort(Arrays.asList((Weaver) null));

Review Comment:
   Hi @nhojpatrick 
   Please remove the local variable.



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

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

Reply via email to