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

OZG-5412 intelliform-adapter: Test group name

parent 2d181bfb
Branches
Tags
No related merge requests found
......@@ -52,6 +52,7 @@ import org.xml.sax.SAXException;
import de.ozgcloud.eingang.common.errorhandling.TechnicalException;
import de.ozgcloud.eingang.common.formdata.FormData;
import de.ozgcloud.eingang.common.formdata.IncomingFile;
import de.ozgcloud.eingang.common.formdata.IncomingFileGroup;
import lombok.SneakyThrows;
class DepositDataMapperTest {
......@@ -100,19 +101,30 @@ class DepositDataMapperTest {
var formData = doMapping();
var incomingFileIds = formData.getRepresentations().stream().map(IncomingFile::getVendorId).toList();
assertThat(incomingFileIds).contains(XML_ATTACHMENT_ID, PDF_ATTACHMENT_ID);
assertThat(incomingFileIds).containsExactly(XML_ATTACHMENT_ID, PDF_ATTACHMENT_ID);
}
@DisplayName("should return with attachments")
@DisplayName("should return with one attachment")
@Test
void shouldReturnWithAttachments() {
void shouldReturnWithOneAttachment() {
var formData = doMapping();
var incomingFileIds = formData.getAttachments().stream()
.flatMap(group -> group.getFiles().stream())
.map(IncomingFile::getVendorId)
.toList();
assertThat(incomingFileIds).contains(PNG_ATTACHMENT_ID);
assertThat(incomingFileIds).containsExactly(PNG_ATTACHMENT_ID);
}
@DisplayName("should return with attachment group name")
@Test
void shouldReturnWithAttachmentGroupName() {
var formData = doMapping();
var incomingFileIds = formData.getAttachments().stream()
.map(IncomingFileGroup::getName)
.toList();
assertThat(incomingFileIds).containsExactly("Upload1");
}
@DisplayName("should return with number of representations")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment