Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • ozg-cloud/app/administration
1 result
Select Git revision
Show changes
Commits on Source (2)
Showing
with 70 additions and 3 deletions
...@@ -61,6 +61,10 @@ public class AggregationMapping { ...@@ -61,6 +61,10 @@ public class AggregationMapping {
@NotEmpty(message = FIELD_IS_EMPTY) @NotEmpty(message = FIELD_IS_EMPTY)
private String name; private String name;
private String parent;
private Status status;
private Scope scope;
@Valid @Valid
private FormIdentifier formIdentifier; private FormIdentifier formIdentifier;
...@@ -88,4 +92,12 @@ public class AggregationMapping { ...@@ -88,4 +92,12 @@ public class AggregationMapping {
@NotBlank(message = FIELD_IS_EMPTY) @NotBlank(message = FIELD_IS_EMPTY)
private String formId; private String formId;
} }
enum Status {
AUSSTEHEND, FREIGEGEBEN, ZURUECKGEHALTEN
}
enum Scope {
LAND, MANDANT
}
} }
...@@ -43,6 +43,9 @@ public class ReportingAggregationManagerSettingDto { ...@@ -43,6 +43,9 @@ public class ReportingAggregationManagerSettingDto {
static class AggregationMappingDto { static class AggregationMappingDto {
private FormIdentifierDto formIdentifier; private FormIdentifierDto formIdentifier;
private String name; private String name;
private String parent;
private StatusDto status;
private ScopeDto scope;
@Singular @Singular
private List<FieldMappingDto> fieldMappings; private List<FieldMappingDto> fieldMappings;
} }
...@@ -60,4 +63,12 @@ public class ReportingAggregationManagerSettingDto { ...@@ -60,4 +63,12 @@ public class ReportingAggregationManagerSettingDto {
private String sourcePath; private String sourcePath;
private String targetPath; private String targetPath;
} }
enum StatusDto {
AUSSTEHEND, FREIGEGEBEN, ZURUECKGEHALTEN
}
enum ScopeDto {
LAND, MANDANT
}
} }
...@@ -5,11 +5,16 @@ import static de.ozgcloud.admin.reporting.AggregationMappingTestFactory.*; ...@@ -5,11 +5,16 @@ import static de.ozgcloud.admin.reporting.AggregationMappingTestFactory.*;
import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.AggregationMappingDto; import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.AggregationMappingDto;
import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.FieldMappingDto; import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.FieldMappingDto;
import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.FormIdentifierDto; import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.FormIdentifierDto;
import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.ScopeDto;
import de.ozgcloud.admin.reporting.ReportingAggregationManagerSettingDto.StatusDto;
public class AggregationMappingDtoTestFactory { public class AggregationMappingDtoTestFactory {
public static final FormIdentifierDto FORM_IDENTIFIER = FormIdentifierDto.builder().formId(FORM_ID).formEngineName(FORM_ENGINE_NAME).build(); public static final FormIdentifierDto FORM_IDENTIFIER = FormIdentifierDto.builder().formId(FORM_ID).formEngineName(FORM_ENGINE_NAME).build();
public static final String NAME = AggregationMappingTestFactory.NAME; public static final String NAME = AggregationMappingTestFactory.NAME;
public static final String PARENT = AggregationMappingTestFactory.PARENT;
public static final StatusDto STATUS = StatusDto.valueOf(AggregationMappingTestFactory.STATUS.name());
public static final ScopeDto SCOPE = ScopeDto.valueOf(AggregationMappingTestFactory.SCOPE.name());
public static AggregationMappingDto create() { public static AggregationMappingDto create() {
return createBuilder().build(); return createBuilder().build();
...@@ -19,6 +24,9 @@ public class AggregationMappingDtoTestFactory { ...@@ -19,6 +24,9 @@ public class AggregationMappingDtoTestFactory {
return AggregationMappingDto.builder() return AggregationMappingDto.builder()
.formIdentifier(FORM_IDENTIFIER) .formIdentifier(FORM_IDENTIFIER)
.name(NAME) .name(NAME)
.parent(PARENT)
.status(STATUS)
.scope(SCOPE)
.fieldMapping(FieldMappingDto.builder().sourcePath(SOURCE_PATH).targetPath(TARGET_PATH).build()); .fieldMapping(FieldMappingDto.builder().sourcePath(SOURCE_PATH).targetPath(TARGET_PATH).build());
} }
} }
...@@ -36,6 +36,8 @@ import org.springframework.data.mongodb.core.MongoOperations; ...@@ -36,6 +36,8 @@ import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.ResultActions;
import de.ozgcloud.admin.reporting.AggregationMapping.Scope;
import de.ozgcloud.admin.reporting.AggregationMapping.Status;
import de.ozgcloud.admin.setting.PropertiesTestFactory; import de.ozgcloud.admin.setting.PropertiesTestFactory;
import de.ozgcloud.common.test.DataITCase; import de.ozgcloud.common.test.DataITCase;
import lombok.SneakyThrows; import lombok.SneakyThrows;
...@@ -78,6 +80,9 @@ public class AggregationMappingEnvironmentSettingITCase { ...@@ -78,6 +80,9 @@ public class AggregationMappingEnvironmentSettingITCase {
.formId(PropertiesTestFactory.FORM_ID_1) .formId(PropertiesTestFactory.FORM_ID_1)
.build()) .build())
.name(PropertiesTestFactory.NAME_1) .name(PropertiesTestFactory.NAME_1)
.parent(PropertiesTestFactory.PARENT_1)
.status(Status.valueOf(PropertiesTestFactory.STATUS_1))
.scope(Scope.valueOf(PropertiesTestFactory.SCOPE_1))
.mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_1_1) .mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_1_1)
.targetPath(PropertiesTestFactory.TARGET_PATH_1_1).build()) .targetPath(PropertiesTestFactory.TARGET_PATH_1_1).build())
.mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_1_2) .mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_1_2)
...@@ -91,6 +96,9 @@ public class AggregationMappingEnvironmentSettingITCase { ...@@ -91,6 +96,9 @@ public class AggregationMappingEnvironmentSettingITCase {
.formId(PropertiesTestFactory.FORM_ID_2) .formId(PropertiesTestFactory.FORM_ID_2)
.build()) .build())
.name(PropertiesTestFactory.NAME_2) .name(PropertiesTestFactory.NAME_2)
.parent(PropertiesTestFactory.PARENT_2)
.status(Status.valueOf(PropertiesTestFactory.STATUS_2))
.scope(Scope.valueOf(PropertiesTestFactory.SCOPE_2))
.mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_2_1) .mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_2_1)
.targetPath(PropertiesTestFactory.TARGET_PATH_2_1).build()) .targetPath(PropertiesTestFactory.TARGET_PATH_2_1).build())
.mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_2_2) .mapping(AggregationMapping.FieldMapping.builder().sourcePath(PropertiesTestFactory.SOURCE_PATH_2_2)
......
...@@ -25,8 +25,12 @@ package de.ozgcloud.admin.reporting; ...@@ -25,8 +25,12 @@ package de.ozgcloud.admin.reporting;
import java.util.UUID; import java.util.UUID;
import com.thedeanda.lorem.LoremIpsum;
import de.ozgcloud.admin.reporting.AggregationMapping.FieldMapping; import de.ozgcloud.admin.reporting.AggregationMapping.FieldMapping;
import de.ozgcloud.admin.reporting.AggregationMapping.FormIdentifier; import de.ozgcloud.admin.reporting.AggregationMapping.FormIdentifier;
import de.ozgcloud.admin.reporting.AggregationMapping.Scope;
import de.ozgcloud.admin.reporting.AggregationMapping.Status;
public class AggregationMappingTestFactory { public class AggregationMappingTestFactory {
...@@ -34,6 +38,9 @@ public class AggregationMappingTestFactory { ...@@ -34,6 +38,9 @@ public class AggregationMappingTestFactory {
public static final String NAME = "Test Auswertung"; public static final String NAME = "Test Auswertung";
public static final String FORM_ENGINE_NAME = "A12"; public static final String FORM_ENGINE_NAME = "A12";
public static final String FORM_ID = "42"; public static final String FORM_ID = "42";
public static final String PARENT = LoremIpsum.getInstance().getName();
public static final Status STATUS = Status.AUSSTEHEND;
public static final Scope SCOPE = Scope.MANDANT;
public static final String SOURCE_PATH = "name"; public static final String SOURCE_PATH = "name";
public static final String TARGET_PATH = "antragsteller.name"; public static final String TARGET_PATH = "antragsteller.name";
...@@ -46,6 +53,9 @@ public class AggregationMappingTestFactory { ...@@ -46,6 +53,9 @@ public class AggregationMappingTestFactory {
return AggregationMapping.builder() return AggregationMapping.builder()
.id(UUID.randomUUID().toString()) .id(UUID.randomUUID().toString())
.name(NAME) .name(NAME)
.parent(PARENT)
.status(STATUS)
.scope(SCOPE)
.formIdentifier(FormIdentifier.builder() .formIdentifier(FormIdentifier.builder()
.formEngineName(FORM_ENGINE_NAME) .formEngineName(FORM_ENGINE_NAME)
.formId(FORM_ID) .formId(FORM_ID)
......
...@@ -69,7 +69,7 @@ class ReportingAggregationManagerSettingDtoServiceTest { ...@@ -69,7 +69,7 @@ class ReportingAggregationManagerSettingDtoServiceTest {
void shouldBuildDto() { void shouldBuildDto() {
var dto = service.mapToDto(List.of(AggregationMappingTestFactory.create())); var dto = service.mapToDto(List.of(AggregationMappingTestFactory.create()));
assertThat(dto).usingRecursiveComparison().isEqualTo(ReportingAggregationMAnagerSettingDtoTestFactory.create()); assertThat(dto).usingRecursiveComparison().isEqualTo(ReportingAggregationManagerSettingDtoTestFactory.create());
} }
} }
...@@ -81,7 +81,7 @@ class ReportingAggregationManagerSettingDtoServiceTest { ...@@ -81,7 +81,7 @@ class ReportingAggregationManagerSettingDtoServiceTest {
@BeforeEach @BeforeEach
void disableMapToDtoFunction() { void disableMapToDtoFunction() {
doReturn(ReportingAggregationMAnagerSettingDtoTestFactory.create()).when(service).mapToDto(any()); doReturn(ReportingAggregationManagerSettingDtoTestFactory.create()).when(service).mapToDto(any());
} }
@Test @Test
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
package de.ozgcloud.admin.reporting; package de.ozgcloud.admin.reporting;
class ReportingAggregationMAnagerSettingDtoTestFactory { class ReportingAggregationManagerSettingDtoTestFactory {
public static ReportingAggregationManagerSettingDto create() { public static ReportingAggregationManagerSettingDto create() {
return createBuilder().build(); return createBuilder().build();
......
...@@ -37,6 +37,9 @@ public class PropertiesTestFactory { ...@@ -37,6 +37,9 @@ public class PropertiesTestFactory {
public static final String FORM_ENGINE_NAME_1 = LoremIpsum.getInstance().getWords(1); public static final String FORM_ENGINE_NAME_1 = LoremIpsum.getInstance().getWords(1);
public static final String FORM_ID_1 = LoremIpsum.getInstance().getWords(1); public static final String FORM_ID_1 = LoremIpsum.getInstance().getWords(1);
public static final String NAME_1 = LoremIpsum.getInstance().getWords(1); public static final String NAME_1 = LoremIpsum.getInstance().getWords(1);
public static final String PARENT_1 = LoremIpsum.getInstance().getWords(1);
public static final String STATUS_1 = "AUSSTEHEND";
public static final String SCOPE_1 = "MANDANT";
public static final String SOURCE_PATH_1_1 = LoremIpsum.getInstance().getWords(1); public static final String SOURCE_PATH_1_1 = LoremIpsum.getInstance().getWords(1);
public static final String TARGET_PATH_1_1 = LoremIpsum.getInstance().getWords(1); public static final String TARGET_PATH_1_1 = LoremIpsum.getInstance().getWords(1);
public static final String SOURCE_PATH_1_2 = LoremIpsum.getInstance().getWords(1); public static final String SOURCE_PATH_1_2 = LoremIpsum.getInstance().getWords(1);
...@@ -46,6 +49,9 @@ public class PropertiesTestFactory { ...@@ -46,6 +49,9 @@ public class PropertiesTestFactory {
public static final String FORM_ENGINE_NAME_2 = LoremIpsum.getInstance().getWords(1); public static final String FORM_ENGINE_NAME_2 = LoremIpsum.getInstance().getWords(1);
public static final String FORM_ID_2 = LoremIpsum.getInstance().getWords(1); public static final String FORM_ID_2 = LoremIpsum.getInstance().getWords(1);
public static final String NAME_2 = LoremIpsum.getInstance().getWords(1); public static final String NAME_2 = LoremIpsum.getInstance().getWords(1);
public static final String PARENT_2 = LoremIpsum.getInstance().getWords(1);
public static final String STATUS_2 = "FREIGEGEBEN";
public static final String SCOPE_2 = "LAND";
public static final String SOURCE_PATH_2_1 = LoremIpsum.getInstance().getWords(1); public static final String SOURCE_PATH_2_1 = LoremIpsum.getInstance().getWords(1);
public static final String TARGET_PATH_2_1 = LoremIpsum.getInstance().getWords(1); public static final String TARGET_PATH_2_1 = LoremIpsum.getInstance().getWords(1);
public static final String SOURCE_PATH_2_2 = LoremIpsum.getInstance().getWords(1); public static final String SOURCE_PATH_2_2 = LoremIpsum.getInstance().getWords(1);
...@@ -79,6 +85,9 @@ public class PropertiesTestFactory { ...@@ -79,6 +85,9 @@ public class PropertiesTestFactory {
FORM_ENGINE_NAME_1, FORM_ENGINE_NAME_1,
FORM_ID_1, FORM_ID_1,
NAME_1, NAME_1,
PARENT_1,
STATUS_1,
SCOPE_1,
SOURCE_PATH_1_1, SOURCE_PATH_1_1,
TARGET_PATH_1_1, TARGET_PATH_1_1,
SOURCE_PATH_1_2, SOURCE_PATH_1_2,
...@@ -88,6 +97,9 @@ public class PropertiesTestFactory { ...@@ -88,6 +97,9 @@ public class PropertiesTestFactory {
FORM_ENGINE_NAME_2, FORM_ENGINE_NAME_2,
FORM_ID_2, FORM_ID_2,
NAME_2, NAME_2,
PARENT_2,
STATUS_2,
SCOPE_2,
SOURCE_PATH_2_1, SOURCE_PATH_2_1,
TARGET_PATH_2_1, TARGET_PATH_2_1,
SOURCE_PATH_2_2, SOURCE_PATH_2_2,
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
"ozgcloud.aggregation.aggregationMappings[0].formIdentifier.formEngineName": "%s", "ozgcloud.aggregation.aggregationMappings[0].formIdentifier.formEngineName": "%s",
"ozgcloud.aggregation.aggregationMappings[0].formIdentifier.formId": "%s", "ozgcloud.aggregation.aggregationMappings[0].formIdentifier.formId": "%s",
"ozgcloud.aggregation.aggregationMappings[0].name": "%s", "ozgcloud.aggregation.aggregationMappings[0].name": "%s",
"ozgcloud.aggregation.aggregationMappings[0].parent": "%s",
"ozgcloud.aggregation.aggregationMappings[0].status": "%s",
"ozgcloud.aggregation.aggregationMappings[0].scope": "%s",
"ozgcloud.aggregation.aggregationMappings[0].fieldMappings[0].sourcePath": "%s", "ozgcloud.aggregation.aggregationMappings[0].fieldMappings[0].sourcePath": "%s",
"ozgcloud.aggregation.aggregationMappings[0].fieldMappings[0].targetPath": "%s", "ozgcloud.aggregation.aggregationMappings[0].fieldMappings[0].targetPath": "%s",
"ozgcloud.aggregation.aggregationMappings[0].fieldMappings[1].sourcePath": "%s", "ozgcloud.aggregation.aggregationMappings[0].fieldMappings[1].sourcePath": "%s",
...@@ -22,6 +25,9 @@ ...@@ -22,6 +25,9 @@
"ozgcloud.aggregation.aggregationMappings[1].formIdentifier.formEngineName": "%s", "ozgcloud.aggregation.aggregationMappings[1].formIdentifier.formEngineName": "%s",
"ozgcloud.aggregation.aggregationMappings[1].formIdentifier.formId": "%s", "ozgcloud.aggregation.aggregationMappings[1].formIdentifier.formId": "%s",
"ozgcloud.aggregation.aggregationMappings[1].name": "%s", "ozgcloud.aggregation.aggregationMappings[1].name": "%s",
"ozgcloud.aggregation.aggregationMappings[1].parent": "%s",
"ozgcloud.aggregation.aggregationMappings[1].status": "%s",
"ozgcloud.aggregation.aggregationMappings[1].scope": "%s",
"ozgcloud.aggregation.aggregationMappings[1].fieldMappings[0].sourcePath": "%s", "ozgcloud.aggregation.aggregationMappings[1].fieldMappings[0].sourcePath": "%s",
"ozgcloud.aggregation.aggregationMappings[1].fieldMappings[0].targetPath": "%s", "ozgcloud.aggregation.aggregationMappings[1].fieldMappings[0].targetPath": "%s",
"ozgcloud.aggregation.aggregationMappings[1].fieldMappings[1].sourcePath": "%s", "ozgcloud.aggregation.aggregationMappings[1].fieldMappings[1].sourcePath": "%s",
......