From: Kai Moritz Date: Mon, 15 Aug 2022 16:53:10 +0000 (+0200) Subject: fix: Fehlerhafte Erwartung korrigiert X-Git-Tag: sumup-adder---lvm-2-tage~18 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=0cd07d4498de934aefece33e20eee0df684e62e5;p=demos%2Fkafka%2Ftraining fix: Fehlerhafte Erwartung korrigiert --- 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}")