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

OZG-7350 implement code review comments

parent 07dac959
No related branches found
No related tags found
No related merge requests found
...@@ -122,8 +122,8 @@ public abstract class CollaborationRequestMapper { ...@@ -122,8 +122,8 @@ public abstract class CollaborationRequestMapper {
@Mapping(target = "allFields", ignore = true) @Mapping(target = "allFields", ignore = true)
public abstract GrpcCollaborationRequest toGrpcCollaborationRequest(CollaborationRequest request); public abstract GrpcCollaborationRequest toGrpcCollaborationRequest(CollaborationRequest request);
@Mapping(target = "organisationsEinheitId", source = "zustaendigeStelle.subjectId") @Mapping(target = "organisationEinheitId", source = "zustaendigeStelle.subjectId")
@Mapping(target = "organisationsEinheitIdBytes", ignore = true) @Mapping(target = "organisationEinheitIdBytes", ignore = true)
@Mapping(target = "mergeFrom", ignore = true) @Mapping(target = "mergeFrom", ignore = true)
@Mapping(target = "clearField", ignore = true) @Mapping(target = "clearField", ignore = true)
@Mapping(target = "clearOneof", ignore = true) @Mapping(target = "clearOneof", ignore = true)
...@@ -148,9 +148,8 @@ public abstract class CollaborationRequestMapper { ...@@ -148,9 +148,8 @@ public abstract class CollaborationRequestMapper {
return CollaborationRequestId.from(id); return CollaborationRequestId.from(id);
} }
@SuppressWarnings("unchecked")
Fachstelle getZustaendigeStelleFromItemMap(Map<String, Object> propertyMap) { Fachstelle getZustaendigeStelleFromItemMap(Map<String, Object> propertyMap) {
return fachstelleMapper.fromMap((Map<String, Object>) propertyMap.get(CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE)); return fachstelleMapper.fromMap(MapUtils.getMap(propertyMap, CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE));
} }
int getIntProperty(String key, Map<String, Object> propertyMap) { int getIntProperty(String key, Map<String, Object> propertyMap) {
......
...@@ -2,6 +2,7 @@ package de.ozgcloud.collaboration.fachstelle; ...@@ -2,6 +2,7 @@ package de.ozgcloud.collaboration.fachstelle;
import java.util.Map; import java.util.Map;
import org.apache.commons.collections.MapUtils;
import org.mapstruct.AnnotateWith; import org.mapstruct.AnnotateWith;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mapping; import org.mapstruct.Mapping;
...@@ -37,11 +38,11 @@ public interface FachstelleMapper { ...@@ -37,11 +38,11 @@ public interface FachstelleMapper {
Fachstelle.PROPERTY_TYPE, fachstelle.getType().name()); Fachstelle.PROPERTY_TYPE, fachstelle.getType().name());
} }
default Fachstelle fromMap(Map<String, Object> fachstelleMap) { default Fachstelle fromMap(Map<?, ?> fachstelleMap) {
return Fachstelle.builder() return Fachstelle.builder()
.technicalId((String) fachstelleMap.get(Fachstelle.PROPERTY_TECHNICAL_ID)) .technicalId((String) fachstelleMap.get(Fachstelle.PROPERTY_TECHNICAL_ID))
.subjectId((String) fachstelleMap.get(Fachstelle.PROPERTY_SUBJECT_ID)) .subjectId((String) fachstelleMap.get(Fachstelle.PROPERTY_SUBJECT_ID))
.type(FachstelleType.valueOf((String) fachstelleMap.get(Fachstelle.PROPERTY_TYPE))) .type(FachstelleType.valueOf(MapUtils.getString(fachstelleMap, Fachstelle.PROPERTY_TYPE)))
.build(); .build();
} }
} }
...@@ -15,6 +15,6 @@ public class GrpcCreateCollaborationRequestDataTestFactory { ...@@ -15,6 +15,6 @@ public class GrpcCreateCollaborationRequestDataTestFactory {
return GrpcCreateCollaborationRequestData.newBuilder() return GrpcCreateCollaborationRequestData.newBuilder()
.setCollaborationLevel(CollaborationRequestTestFactory.COLLABORATION_LEVEL) .setCollaborationLevel(CollaborationRequestTestFactory.COLLABORATION_LEVEL)
.setVorgangId(CommandTestFactory.VORGANG_ID) .setVorgangId(CommandTestFactory.VORGANG_ID)
.setOrganisationsEinheitId(FachstelleTestFactory.SUBJECT_ID); .setOrganisationEinheitId(FachstelleTestFactory.SUBJECT_ID);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment