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>
Sun, 14 Aug 2022 13:14:53 +0000 (15:14 +0200)
src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java

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