Skip to content
Snippets Groups Projects
Commit d92e5840 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4391 OZG-4417 improve test structure

parent 7d8d8a55
Branches
Tags
No related merge requests found
......@@ -385,27 +385,6 @@ class VorgangWithEingangProzessorTest {
@Nested
class TestIsCreateBescheidEnabled {
@BeforeEach
void setUp() {
when(featureToggleProperties.isCreateBescheid()).thenReturn(true);
}
@Test
void shouldCallFeatureToggleProperties() {
callProcessor(VorgangWithEingangTestFactory.create());
verify(featureToggleProperties).isCreateBescheid();
}
@Test
void shouldCallHasVorgangCreateBescheidEnabled() {
var vorgang = VorgangWithEingangTestFactory.create();
callProcessor(vorgang);
verify(processor).hasVorgangCreateBescheidEnabled(vorgang);
}
@Nested
class TestFeatureToggleDisabled {
......@@ -414,6 +393,22 @@ class VorgangWithEingangProzessorTest {
when(featureToggleProperties.isCreateBescheid()).thenReturn(false);
}
@Test
void shouldCallFeatureToggleProperties() {
callProcessor(VorgangWithEingangTestFactory.create());
verify(featureToggleProperties).isCreateBescheid();
}
@Test
void shouldNotCallHasVorgangCreateBescheidEnabled() {
var vorgang = VorgangWithEingangTestFactory.create();
callProcessor(vorgang);
verify(processor, never()).hasVorgangCreateBescheidEnabled(vorgang);
}
@Test
void shouldReturnFalse() {
var isEnabled = callProcessor(VorgangWithEingangTestFactory.create());
......@@ -432,6 +427,22 @@ class VorgangWithEingangProzessorTest {
when(featureToggleProperties.isCreateBescheid()).thenReturn(true);
}
@Test
void shouldCallFeatureToggleProperties() {
callProcessor(VorgangWithEingangTestFactory.create());
verify(featureToggleProperties).isCreateBescheid();
}
@Test
void shouldCallHasVorgangCreateBescheidEnabled() {
var vorgang = VorgangWithEingangTestFactory.create();
callProcessor(vorgang);
verify(processor).hasVorgangCreateBescheidEnabled(vorgang);
}
@Test
void shouldReturnTrue() {
doReturn(true).when(processor).hasVorgangCreateBescheidEnabled(vorgang);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment