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

Merge branch 'release-2.0.1' into release

parents 6e34d61b 22cf1d9c
No related branches found
No related tags found
No related merge requests found
...@@ -71,12 +71,14 @@ class FormSolutionsRequestMapper { ...@@ -71,12 +71,14 @@ class FormSolutionsRequestMapper {
.formData(buildFormDataMap(eingang)) .formData(buildFormDataMap(eingang))
.attachments(attachmentMapper.mapAttachments(eingang.getZip())) .attachments(attachmentMapper.mapAttachments(eingang.getZip()))
.representation(buildJsonFile(jsonFile)); .representation(buildJsonFile(jsonFile));
var numberOfRepresentations = 1;
if (Objects.nonNull(eingang.getPdf())) { if (Objects.nonNull(eingang.getPdf())) {
builder.representation(buildPdfFile(eingang.getPdf())); builder.representation(buildPdfFile(eingang.getPdf()));
numberOfRepresentations++;
} }
return builder.build(); return builder.numberOfRepresentations(numberOfRepresentations).build();
} }
Map<String, Object> buildFormDataMap(FormSolutionsEingang eingang) { Map<String, Object> buildFormDataMap(FormSolutionsEingang eingang) {
......
...@@ -251,6 +251,12 @@ class FormSolutionsRequestMapperTest { ...@@ -251,6 +251,12 @@ class FormSolutionsRequestMapperTest {
assertThat(result.getRepresentations()).hasSize(2); 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