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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git

commit ea710145f34c0a4a286e22d93c11388584452b43
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu May 5 15:58:25 2022 -0400

    Fix broken tests.
---
 .../commons/compress/utils/ServiceLoaderIteratorTest.java     | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/compress/utils/ServiceLoaderIteratorTest.java
 
b/src/test/java/org/apache/commons/compress/utils/ServiceLoaderIteratorTest.java
index 6aaac6e7..ee5ec114 100644
--- 
a/src/test/java/org/apache/commons/compress/utils/ServiceLoaderIteratorTest.java
+++ 
b/src/test/java/org/apache/commons/compress/utils/ServiceLoaderIteratorTest.java
@@ -18,11 +18,12 @@
  */
 package org.apache.commons.compress.utils;
 
-import org.junit.jupiter.api.Test;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
 
 import java.util.NoSuchElementException;
 
-import static org.junit.Assert.assertFalse;
+import org.junit.jupiter.api.Test;
 
 /**
  * Unit tests for class {@link ServiceLoaderIterator 
org.apache.commons.compress.utils.ServiceLoaderIterator}.
@@ -36,7 +37,7 @@ public class ServiceLoaderIteratorTest {
     public void testNextThrowsNoSuchElementException() {
         final Class<String> clasz = String.class;
         final ServiceLoaderIterator<String> serviceLoaderIterator = new 
ServiceLoaderIterator<>(clasz);
-        serviceLoaderIterator.next();
+        assertThrows(NoSuchElementException.class, () -> 
serviceLoaderIterator.next());
     }
 
     @Test
@@ -51,7 +52,7 @@ public class ServiceLoaderIteratorTest {
     public void testRemoveThrowsUnsupportedOperationException() {
         final Class<Integer> clasz = Integer.class;
         final ServiceLoaderIterator<Integer> serviceLoaderIterator = new 
ServiceLoaderIterator<>(clasz);
-        serviceLoaderIterator.remove();
+        assertThrows(UnsupportedOperationException.class, () -> 
serviceLoaderIterator.remove());
     }
 
-}
\ No newline at end of file
+}

Reply via email to