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

test: Cleanup itcase

parent 0e4ac069
Branches
Tags 2.18.0
No related merge requests found
......@@ -117,8 +117,6 @@ class FormDataEndpointITCase {
private MockWebServiceClient mockClient;
private DepositData depositData;
private final String vorgangId = UUID.randomUUID().toString();
@BeforeAll
......@@ -146,15 +144,12 @@ class FormDataEndpointITCase {
@Nested
class TestSendAntragWithManyAttachments {
@BeforeEach
void mock() {
depositData = DepositDataTestFactory.create(MANY_ATTACHMENTS);
}
private final DepositData depositData = DepositDataTestFactory.create(MANY_ATTACHMENTS);
@DisplayName("should map antragsteller nachname")
@Test
void shouldMapAntragstellerNachname() {
sendDepositAndCaptureCreateVorgang();
sendDepositAndCaptureCreateVorgang(depositData);
var antragsteller = getCapturedAntragsteller();
assertThat(antragsteller.getNachname()).isEqualTo(ANTRAGSTELLER_NACHNAME);
......@@ -163,7 +158,7 @@ class FormDataEndpointITCase {
@DisplayName("should map antragsteller anrede")
@Test
void shouldMapAntragstellerAnrede() {
sendDepositAndCaptureCreateVorgang();
sendDepositAndCaptureCreateVorgang(depositData);
var antragsteller = getCapturedAntragsteller();
assertThat(antragsteller.getAnrede()).isEqualTo(ANTRAGSTELLER_ANREDE);
......@@ -176,7 +171,7 @@ class FormDataEndpointITCase {
@DisplayName("should have representations")
@Test
void shouldHaveRepresentations() {
sendDepositAndCaptureCreateVorgang();
sendDepositAndCaptureCreateVorgang(depositData);
var eingang = grpcEingangCaptor.getValue();
var representationVendorIds = eingang.getRepresentationsList().stream()
......@@ -191,7 +186,7 @@ class FormDataEndpointITCase {
@DisplayName("should have attachments")
@Test
void shouldHaveAttachments() {
sendDepositAndCaptureCreateVorgang();
sendDepositAndCaptureCreateVorgang(depositData);
var eingang = grpcEingangCaptor.getValue();
var attachmentVendorIds = eingang.getAttachmentsList().stream()
......@@ -218,7 +213,7 @@ class FormDataEndpointITCase {
@DisplayName("should have organisationseinheitenID")
@Test
void shouldHaveOrganisationseinheitenId() {
sendDepositAndCaptureCreateVorgang();
sendDepositAndCaptureCreateVorgang(depositData);
var eingang = grpcEingangCaptor.getValue();
assertThat(eingang.getZustaendigeStelle().getOrganisationseinheitenId()).isEqualTo(ORGANISATIONSEINHEITEN_ID);
......@@ -229,16 +224,14 @@ class FormDataEndpointITCase {
@DisplayName("with duplicate keys")
@Nested
class TestWithDuplicateKeys {
@BeforeEach
void mock() {
depositData = DepositDataTestFactory.create(List.of(
withEmptyName(createXmlDaten()),
createXmlDaten(),
withEmptyName(createPdf()),
createPdf(),
withEmptyName(createPng()),
createPng()));
}
private final DepositData depositData = DepositDataTestFactory.create(List.of(
withEmptyName(createXmlDaten()),
createXmlDaten(),
withEmptyName(createPdf()),
createPdf(),
withEmptyName(createPng()),
createPng()));
private Attachment withEmptyName(Attachment attachment) {
attachment.setName("");
......@@ -248,7 +241,7 @@ class FormDataEndpointITCase {
@DisplayName("should keep last entry for representations")
@Test
void shouldKeepLastEntryForRepresentations() {
sendDepositAndCaptureCreateVorgang();
sendDepositAndCaptureCreateVorgang(depositData);
var eingang = grpcEingangCaptor.getValue();
var representationFiles = eingang.getRepresentationsList();
......@@ -259,7 +252,7 @@ class FormDataEndpointITCase {
@DisplayName("should keep last entry for attachments")
@Test
void shouldKeepLastEntryForAttachments() {
sendDepositAndCaptureCreateVorgang();
sendDepositAndCaptureCreateVorgang(depositData);
var eingang = grpcEingangCaptor.getValue();
var attachmentFiles = eingang.getAttachmentsList().stream()
......@@ -284,7 +277,7 @@ class FormDataEndpointITCase {
}
@SneakyThrows
private void sendDepositAndCaptureCreateVorgang() {
private void sendDepositAndCaptureCreateVorgang(DepositData depositData) {
mockClient.sendRequest(RequestCreators.withPayload(createEnvelopeSourceFromDepositData(depositData)))
.andExpect(ResponseMatchers.noFault())
.andExpect(ResponseMatchers.payload(getResource(RESPONSE)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment