fix: Fehlerhafte Erwartung korrigiert
authorKai Moritz <kai@juplo.de>
Mon, 15 Aug 2022 16:53:10 +0000 (18:53 +0200)
committerKai Moritz <kai@juplo.de>
Mon, 15 Aug 2022 16:53:10 +0000 (18:53 +0200)
src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java

index 435f036..63447e3 100644 (file)
@@ -122,13 +122,14 @@ public class AdderBusinessLogicTest
     assertThatIllegalArgumentException().isThrownBy(() -> adder.addToSum("foo", value));
   }
 
-  @Test
+  @ParameterizedTest(name = "{index}: Adding {0}")
   @DisplayName("Can add a positive value to an existing sum")
-  public void testAddSumWithPositiveValuePossibleIfSumExists()
+  @ValueSource(ints = { 1, 3, 6, 66, 7, 9 })
+  public void testAddSumWithPositiveValuePossibleIfSumExists(int value)
   {
     AdderBusinessLogic adder = new AdderBusinessLogic();
     adder.startSum("foo");
-    assertThatIllegalArgumentException().isThrownBy(() -> adder.addToSum("foo", -1));
+    assertThatNoException().isThrownBy(() -> adder.addToSum("foo", value));
   }
 
   @ParameterizedTest(name = "{index}: Summing up {0}")