Skip to content
Snippets Groups Projects
Commit 7cb4b9a4 authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

OZG-6748 Cleanup MantelantragITCase

parent 357e4cea
Branches
Tags
No related merge requests found
...@@ -26,7 +26,6 @@ import org.springframework.boot.test.mock.mockito.SpyBean; ...@@ -26,7 +26,6 @@ import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource; import org.springframework.test.context.DynamicPropertySource;
import org.springframework.test.context.TestPropertySource;
import de.ozgcloud.common.binaryfile.TempFileUtils; import de.ozgcloud.common.binaryfile.TempFileUtils;
import de.ozgcloud.common.test.TestUtils; import de.ozgcloud.common.test.TestUtils;
...@@ -61,7 +60,7 @@ public class MantelantragITCase { ...@@ -61,7 +60,7 @@ public class MantelantragITCase {
@Autowired @Autowired
MantelantragZustaendigeStelleMapper mantelantragZustaendigeStelleMapper; MantelantragZustaendigeStelleMapper mantelantragZustaendigeStelleMapper;
static List<String> XTA_IDENTIFIERS = Collections.emptyList(); static List<String> xtaIdentifiers = Collections.emptyList();
@BeforeEach @BeforeEach
void mock() { void mock() {
...@@ -73,21 +72,21 @@ public class MantelantragITCase { ...@@ -73,21 +72,21 @@ public class MantelantragITCase {
@DynamicPropertySource @DynamicPropertySource
static void dynamicProperties(DynamicPropertyRegistry registry) { static void dynamicProperties(DynamicPropertyRegistry registry) {
registry.add("ozgcloud.xta.identifiers", () -> XTA_IDENTIFIERS); registry.add("ozgcloud.xta.identifiers", () -> xtaIdentifiers);
} }
@DisplayName("with no matching zusstaendige stelle") @DisplayName("without matching zustaendige stelle")
@Nested @Nested
class TestWithNoMatchingZusstaendigeStelle { class TestWithoutMatchingZustaendigeStelle {
@BeforeAll @BeforeAll
static void setup() { static void setup() {
XTA_IDENTIFIERS = List.of("afmsh:unknown"); xtaIdentifiers = List.of("afmsh:unknown");
} }
@DisplayName("should create one vorgang with no matching zustaendigeStelle") @DisplayName("should create one vorgang")
@Test @Test
void shouldCreateOneVorgangWithNoMatchingZustaendigeStelle() { void shouldCreateOneVorgang() {
semantikAdapter.processFormData(formData); semantikAdapter.processFormData(formData);
verify(vorgangRemoteService, times(1)).createVorgang(formDataCaptor.capture(), oeIdCaptor.capture()); verify(vorgangRemoteService, times(1)).createVorgang(formDataCaptor.capture(), oeIdCaptor.capture());
...@@ -97,16 +96,15 @@ public class MantelantragITCase { ...@@ -97,16 +96,15 @@ public class MantelantragITCase {
@DisplayName("with one matching zustaendige stelle") @DisplayName("with one matching zustaendige stelle")
@Nested @Nested
@TestPropertySource(properties = "ozgcloud.xta.identifiers=afmsh:ozg-cloud-utopia-test")
class TestWithOneMatchingZustaendigeStelle { class TestWithOneMatchingZustaendigeStelle {
@BeforeAll @BeforeAll
static void setup() { static void setup() {
XTA_IDENTIFIERS = List.of("afmsh:ozg-cloud-utopia-test"); xtaIdentifiers = List.of("afmsh:ozg-cloud-utopia-test");
} }
@DisplayName("should create one vorgang with no matching zustaendigeStelle") @DisplayName("should create one vorgang")
@Test @Test
void shouldCreateOneVorgangWithNoMatchingZustaendigeStelle() { void shouldCreateOneVorgang() {
semantikAdapter.processFormData(formData); semantikAdapter.processFormData(formData);
verify(vorgangRemoteService, times(1)).createVorgang(formDataCaptor.capture(), oeIdCaptor.capture()); verify(vorgangRemoteService, times(1)).createVorgang(formDataCaptor.capture(), oeIdCaptor.capture());
...@@ -120,7 +118,7 @@ public class MantelantragITCase { ...@@ -120,7 +118,7 @@ public class MantelantragITCase {
@BeforeAll @BeforeAll
static void setup() { static void setup() {
XTA_IDENTIFIERS = List.of("afmsh:ozg-cloud-utopia-test", "gae:ozg-cloud-itcase-test"); xtaIdentifiers = List.of("afmsh:ozg-cloud-utopia-test", "gae:ozg-cloud-itcase-test");
} }
@DisplayName("should create two vorangs with partially matching zustaendigeStelle") @DisplayName("should create two vorangs with partially matching zustaendigeStelle")
...@@ -133,18 +131,18 @@ public class MantelantragITCase { ...@@ -133,18 +131,18 @@ public class MantelantragITCase {
} }
} }
@DisplayName("with three mathcing zustaendige stelle") @DisplayName("with three matching zustaendige stelles")
@Nested @Nested
class TestWithThreeMathcingZustaendigeStelle { class TestWithThreeMatchingZustaendigeStelles {
@BeforeAll @BeforeAll
static void setup() { static void setup() {
XTA_IDENTIFIERS = List.of("afmsh:ozg-cloud-utopia-test", "gae:ozg-cloud-itcase-test", "afmsh:ozg-cloud-bad-segeberg-kreis"); xtaIdentifiers = List.of("afmsh:ozg-cloud-utopia-test", "gae:ozg-cloud-itcase-test", "afmsh:ozg-cloud-bad-segeberg-kreis");
} }
@DisplayName("should create three vorgangs with matching zustaendigeStelle") @DisplayName("should create three vorgangs")
@Test @Test
void shouldCreateThreeVorgangsWithMatchingZustaendigeStelle() { void shouldCreateThreeVorgangs() {
semantikAdapter.processFormData(formData); semantikAdapter.processFormData(formData);
verify(vorgangRemoteService, times(3)).createVorgang(formDataCaptor.capture(), oeIdCaptor.capture()); verify(vorgangRemoteService, times(3)).createVorgang(formDataCaptor.capture(), oeIdCaptor.capture());
......
...@@ -140,9 +140,9 @@ class MantelantragZustaendigeStelleMapperTest { ...@@ -140,9 +140,9 @@ class MantelantragZustaendigeStelleMapperTest {
} }
} }
@DisplayName("get zustaendige stelle list") @DisplayName("get zustaendige stelles")
@Nested @Nested
class TestGetZustaendigeStelleList { class TestGetZustaendigeStelles {
private FormData formData; private FormData formData;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment