From: Kai Moritz Date: Sat, 13 Aug 2022 15:57:38 +0000 (+0200) Subject: ROT: Übersehene Erwartung an SumBusinesLogic.endSum(String) ergänzt X-Git-Tag: sumup-adder---lvm-2-tage~24 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=b6bd8c572ab073b53fd97e6126168b45a56110d4;p=demos%2Fkafka%2Ftraining ROT: Übersehene Erwartung an SumBusinesLogic.endSum(String) ergänzt --- diff --git a/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java b/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java index 0325c63..435f036 100644 --- a/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java +++ b/src/test/java/de/juplo/kafka/AdderBusinessLogicTest.java @@ -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()