From: Kai Moritz Date: Sat, 13 Aug 2022 15:56:41 +0000 (+0200) Subject: refactor: Benennung der Fachlogik-Tests vereinheitlicht X-Git-Tag: sumup-adder---lvm-2-tage~25 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=cfbad8bfab48525b2d2033044ea457447e65b0bb;p=demos%2Fkafka%2Ftraining refactor: Benennung der Fachlogik-Tests vereinheitlicht --- diff --git a/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java b/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java index 6f114d2..0325c63 100644 --- a/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java +++ b/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java @@ -18,7 +18,7 @@ public class AdderBusinessLogicTest { @Test @DisplayName("A new sum can be started, if it does not exist") - public void testCanStartSumIfNotExists() + public void testStartSumPossibleIfNotExists() { AdderBusinessLogic adder = new AdderBusinessLogic(); assertThatNoException().isThrownBy(() -> adder.startSum("foo")); @@ -35,7 +35,7 @@ public class AdderBusinessLogicTest @Test @DisplayName("An empty Optional should be returned, for a non-existing sum") - public void testEmptyOptionalForNonExistingSum() + public void testGetSumReturnsEmptyOptionalForNonExistingSum() { AdderBusinessLogic adder = new AdderBusinessLogic(); assertThat(adder.getSum("foo")).isEmpty(); @@ -43,7 +43,7 @@ public class AdderBusinessLogicTest @Test @DisplayName("A non-empty Optional should be returned, for an existing sum") - public void testNonEmptyOptionalForExistingSum() + public void testGetSumReturnsNonEmptyOptionalForExistingSum() { AdderBusinessLogic adder = new AdderBusinessLogic(); adder.startSum("foo"); @@ -52,7 +52,7 @@ public class AdderBusinessLogicTest @Test @DisplayName("A sum can be ended, if it does exist") - public void testCanEndIfSumExists() + public void testEndSumPossibleIfSumExists() { AdderBusinessLogic adder = new AdderBusinessLogic(); adder.startSum("foo"); @@ -95,7 +95,7 @@ public class AdderBusinessLogicTest @Test @DisplayName("Adding a null-value to an existing sum causes an IllegalArgumentException") - public void testAddNullToExistingSumCausesException() + public void testAddSumWithNullValueToExistingSumCausesException() { AdderBusinessLogic adder = new AdderBusinessLogic(); adder.startSum("foo"); @@ -105,7 +105,7 @@ public class AdderBusinessLogicTest @ParameterizedTest(name = "{index}: Adding {0}") @DisplayName("Adding a non-positive value to an existing sum causes an IllegalArgumentException") @ValueSource(ints = { 0, -1, -6, -66, Integer.MIN_VALUE }) - public void testAddingNonPositiveValueToExistingSumCausesException(int value) + public void testAddSumWithNonPositiveValueToExistingSumCausesException(int value) { AdderBusinessLogic adder = new AdderBusinessLogic(); adder.startSum("foo"); @@ -114,7 +114,7 @@ public class AdderBusinessLogicTest @Test @DisplayName("Can add a positive value to an existing sum") - public void testCanAddPositiveValueToExistingSum() + public void testAddSumWithPositiveValuePossibleIfSumExists() { AdderBusinessLogic adder = new AdderBusinessLogic(); adder.startSum("foo"); @@ -124,7 +124,7 @@ public class AdderBusinessLogicTest @ParameterizedTest(name = "{index}: Summing up {0}") @DisplayName("Adds up numbers correctly") @MethodSource("numbersProvider") - public void testCanAddPositiveValueToExistingSum(int... numbers) + public void testAddSumAddsUpNumbersCorrectlyIfSumExists(int... numbers) { long expectedResult = Arrays.stream(numbers).sum(); AdderBusinessLogic adder = new AdderBusinessLogic();