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-collections.git
commit dea79e62f188ac408bee0958e1f9e8700bf2ebcd Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun Mar 31 09:58:38 2024 -0400 Use JUnit Assumptions --- .../multimap/AbstractMultiValuedMapTest.java | 35 +++++++--------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java index dddc00cd9..de47f4c68 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java @@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.util.ArrayList; import java.util.Arrays; @@ -701,9 +700,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test @SuppressWarnings("unchecked") public void testAddMappingThroughGet() { - if (!isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); resetEmpty(); final MultiValuedMap<K, V> map = getMap(); final Collection<V> col1 = map.get((K) "k0"); @@ -971,9 +968,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test @SuppressWarnings("unchecked") public void testMapEquals() { - if (!isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); final MultiValuedMap<K, V> one = makeObject(); final Integer value = Integer.valueOf(1); one.put((K) "One", (V) value); @@ -1080,9 +1075,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test @SuppressWarnings("unchecked") public void testPutAll_KeyIterable() { - if (!isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); final MultiValuedMap<K, V> map = makeObject(); Collection<V> coll = (Collection<V>) Arrays.asList("X", "Y", "Z"); @@ -1118,9 +1111,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test @SuppressWarnings("unchecked") public void testPutAll_Map1() { - if (!isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); final MultiValuedMap<K, V> original = makeObject(); original.put((K) "key", (V) "object1"); original.put((K) "key", (V) "object2"); @@ -1147,9 +1138,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test @SuppressWarnings("unchecked") public void testPutAll_Map2() { - if (!isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); final Map<K, V> original = new HashMap<>(); original.put((K) "keyX", (V) "object1"); original.put((K) "keyY", (V) "object2"); @@ -1177,9 +1166,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test @SuppressWarnings("unchecked") public void testRemove_KeyItem() { - if (!isRemoveSupported() || !isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); + assumeTrue(isRemoveSupported()); final MultiValuedMap<K, V> map = makeObject(); map.put((K) "A", (V) "AA"); map.put((K) "A", (V) "AB"); @@ -1325,9 +1313,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test @SuppressWarnings("unchecked") public void testSizeWithPutRemove() { - if (!isRemoveSupported() || !isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); + assumeTrue(isRemoveSupported()); final MultiValuedMap<K, V> map = makeObject(); assertEquals(0, map.size()); map.put((K) "A", (V) "AA"); @@ -1346,9 +1333,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes @Test public void testToString(){ - if (!isAddSupported()) { - return; - } + assumeTrue(isAddSupported()); final MultiValuedMap<K, V> map = makeObject(); map.put((K) "A", (V) "X"); map.put((K) "A", (V) "Y");