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
No related branches found
No related tags found
Loading
...@@ -385,9 +385,12 @@ class VorgangWithEingangProzessorTest { ...@@ -385,9 +385,12 @@ class VorgangWithEingangProzessorTest {
@Nested @Nested
class TestIsCreateBescheidEnabled { class TestIsCreateBescheidEnabled {
@Nested
class TestFeatureToggleDisabled {
@BeforeEach @BeforeEach
void setUp() { void setUp() {
when(featureToggleProperties.isCreateBescheid()).thenReturn(true); when(featureToggleProperties.isCreateBescheid()).thenReturn(false);
} }
@Test @Test
...@@ -398,20 +401,12 @@ class VorgangWithEingangProzessorTest { ...@@ -398,20 +401,12 @@ class VorgangWithEingangProzessorTest {
} }
@Test @Test
void shouldCallHasVorgangCreateBescheidEnabled() { void shouldNotCallHasVorgangCreateBescheidEnabled() {
var vorgang = VorgangWithEingangTestFactory.create(); var vorgang = VorgangWithEingangTestFactory.create();
callProcessor(vorgang); callProcessor(vorgang);
verify(processor).hasVorgangCreateBescheidEnabled(vorgang); verify(processor, never()).hasVorgangCreateBescheidEnabled(vorgang);
}
@Nested
class TestFeatureToggleDisabled {
@BeforeEach
void setUp() {
when(featureToggleProperties.isCreateBescheid()).thenReturn(false);
} }
@Test @Test
...@@ -432,6 +427,22 @@ class VorgangWithEingangProzessorTest { ...@@ -432,6 +427,22 @@ class VorgangWithEingangProzessorTest {
when(featureToggleProperties.isCreateBescheid()).thenReturn(true); 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 @Test
void shouldReturnTrue() { void shouldReturnTrue() {
doReturn(true).when(processor).hasVorgangCreateBescheidEnabled(vorgang); 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