Skip to content
Snippets Groups Projects
Commit 698c0218 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4797 set number of representation

parent 7298c120
No related branches found
No related tags found
No related merge requests found
......@@ -71,12 +71,14 @@ class FormSolutionsRequestMapper {
.formData(buildFormDataMap(eingang))
.attachments(attachmentMapper.mapAttachments(eingang.getZip()))
.representation(buildJsonFile(jsonFile));
var numberOfRepresentations = 1;
if (Objects.nonNull(eingang.getPdf())) {
builder.representation(buildPdfFile(eingang.getPdf()));
numberOfRepresentations++;
}
return builder.build();
return builder.numberOfRepresentations(numberOfRepresentations).build();
}
Map<String, Object> buildFormDataMap(FormSolutionsEingang eingang) {
......
......@@ -251,6 +251,12 @@ class FormSolutionsRequestMapperTest {
assertThat(result.getRepresentations()).hasSize(2);
}
@Test
void shouldAddNumberOfRepresentations() {
var result = mapper.map(jsonFile);
assertThat(result.getNumberOfRepresentations()).isEqualTo(2);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment