ROT: Übersehene Erwartung an SumBusinesLogic.endSum(String) ergänzt
authorKai Moritz <kai@juplo.de>
Sat, 13 Aug 2022 15:57:38 +0000 (17:57 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 13 Aug 2022 15:57:38 +0000 (17:57 +0200)
src/test/java/de/juplo/kafka/SumBusinessLogicTest.java

index 2519083..ca8716e 100644 (file)
@@ -59,6 +59,16 @@ public class SumBusinessLogicTest
     assertThatNoException().isThrownBy(() -> sumBusinessLogic.endSum("foo"));
   }
 
+  @Test
+  @DisplayName("An existing sum is removed, if ended")
+  public void testEndSumRemovesSumIfSumExists()
+  {
+    SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
+    sumBusinessLogic.startSum("foo");
+    sumBusinessLogic.endSum("foo");
+    assertThat(sumBusinessLogic.getSum("foo")).isEmpty();
+  }
+
   @Test
   @DisplayName("An existing Sum returns a non-null value, if ended")
   public void testEndSumReturnsNonNullValueIfSumExists()