From 817180b4da7e378d12fd918fdf0ae97cf7bdbbd8 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 31 Mar 2024 09:52:52 -0400 Subject: [PATCH] Rework test fixtures Next, grow the amount of data tested to find bugs in the tests with non-repeatable map ordering --- .../collections4/multimap/AbstractMultiValuedMapTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 b9243162c..b4b224da1 100644 --- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java +++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java @@ -804,7 +804,12 @@ public abstract class AbstractMultiValuedMapTest extends AbstractObjectTes @SuppressWarnings("unchecked") public void testContainsValue_Key() { final MultiValuedMap map = makeFullMap(); - assertTrue(map.containsMapping("k0", "v0_1")); + final int maxK = getSampleKeySize(); + final int maxV = getSampleCountPerKey(); + for (int k = 0; k < maxK; k++) { + for (int v = 0; v < maxV; v++) { + assertTrue(map.containsMapping(makeKey(k), makeValue(k, v))); } + } assertFalse(map.containsMapping("k1", "2")); if (!isAddSupported()) { return;