sumBusinessLogic.startSum("foo");
assertThatIllegalStateException().isThrownBy(() -> sumBusinessLogic.startSum("foo"));
}
+
+ @Test
+ @DisplayName("An empty Optional should be returned, for a non-existing sum")
+ public void testEmptyOptionalForNonExistingSum()
+ {
+ SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
+ assertThat(sumBusinessLogic.getSum("foo")).isEmpty();
+ }
+
+ @Test
+ @DisplayName("A non-empty Optional should be returned, for an existing sum")
+ public void testNonEmptyOptionalForExistingSum()
+ {
+ SumBusinessLogic sumBusinessLogic = new SumBusinessLogic();
+ sumBusinessLogic.startSum("foo");
+ assertThat(sumBusinessLogic.getSum("foo")).isNotEmpty();
+ }
}