refactor: Benennung der Fachlogik-Tests vereinheitlicht
authorKai Moritz <kai@juplo.de>
Sat, 13 Aug 2022 15:56:41 +0000 (17:56 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 13 Aug 2022 15:56:41 +0000 (17:56 +0200)
src/test/java/de/juplo/kafka/SumBusinessLogicTest.java

index a0e5e6e..2519083 100644 (file)
@@ -18,7 +18,7 @@ public class SumBusinessLogicTest
 {
   @Test
   @DisplayName("A new sum can be started, if it does not exist")
-  public void testCanStartSumIfNotExists()
+  public void testStartSumPossibleIfNotExists()
   {
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
     assertThatNoException().isThrownBy(() -> sumBusinessLogic.startSum("foo"));
@@ -35,7 +35,7 @@ public class SumBusinessLogicTest
 
   @Test
   @DisplayName("An empty Optional should be returned, for a non-existing sum")
-  public void testEmptyOptionalForNonExistingSum()
+  public void testGetSumReturnsEmptyOptionalForNonExistingSum()
   {
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
     assertThat(sumBusinessLogic.getSum("foo")).isEmpty();
@@ -43,7 +43,7 @@ public class SumBusinessLogicTest
 
   @Test
   @DisplayName("A non-empty Optional should be returned, for an existing sum")
-  public void testNonEmptyOptionalForExistingSum()
+  public void testGetSumReturnsNonEmptyOptionalForExistingSum()
   {
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
     sumBusinessLogic.startSum("foo");
@@ -52,7 +52,7 @@ public class SumBusinessLogicTest
 
   @Test
   @DisplayName("A sum can be ended, if it does exist")
-  public void testCanEndIfSumExists()
+  public void testEndSumPossibleIfSumExists()
   {
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
     sumBusinessLogic.startSum("foo");
@@ -95,7 +95,7 @@ public class SumBusinessLogicTest
 
   @Test
   @DisplayName("Adding a null-value to an existing sum causes an IllegalArgumentException")
-  public void testAddNullToExistingSumCausesException()
+  public void testAddSumWithNullValueToExistingSumCausesException()
   {
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
     sumBusinessLogic.startSum("foo");
@@ -105,7 +105,7 @@ public class SumBusinessLogicTest
   @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)
   {
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
     sumBusinessLogic.startSum("foo");
@@ -114,7 +114,7 @@ public class SumBusinessLogicTest
 
   @Test
   @DisplayName("Can add a positive value to an existing sum")
-  public void testCanAddPositiveValueToExistingSum()
+  public void testAddSumWithPositiveValuePossibleIfSumExists()
   {
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
     sumBusinessLogic.startSum("foo");
@@ -124,7 +124,7 @@ public class SumBusinessLogicTest
   @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();
     SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();