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