Skip to content
Snippets Groups Projects
Commit 70473369 authored by Jan Zickermann's avatar Jan Zickermann
Browse files

OZG-6748 Cleanup MantelantragITCase

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