From 0cd07d4498de934aefece33e20eee0df684e62e5 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 15 Aug 2022 18:53:10 +0200 Subject: [PATCH] fix: Fehlerhafte Erwartung korrigiert --- src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java b/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java index 435f036..63447e3 100644 --- a/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java +++ b/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java @@ -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}") -- 2.20.1