X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Fkafka%2FAdderBusinessLogicTest.java;h=63447e36173021176f906cdb1b7255231930638b;hb=0cd07d4498de934aefece33e20eee0df684e62e5;hp=435f0367688726cfe7a05999808ab420d1655a2d;hpb=a2e8fc924e5b472d6b90c42d311514f91ea452f1;p=demos%2Fkafka%2Ftraining 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}")