diff options
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java')
1 files changed, 14 insertions, 18 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java index 89d210f372..3cabebbb69 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapValidationResponseToDto.java @@ -24,8 +24,6 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.datatypes.error.ErrorMessage; -import org.openecomp.sdc.vendorsoftwareproduct.types.ComponentValidationResult; -import org.openecomp.sdc.vendorsoftwareproduct.types.DeploymentFlavorValidationResult; import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireValidationResult; import org.openecomp.sdc.vendorsoftwareproduct.types.ValidationResponse; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData; @@ -49,37 +47,37 @@ import java.util.Set; import java.util.stream.Collectors; public class MapValidationResponseToDto - extends MappingBase<ValidationResponse, ValidationResponseDto> { + extends MappingBase<ValidationResponse, ValidationResponseDto> { private static Map<String, List<ErrorMessageDto>> mapUploadDataErrors( - Map<String, List<ErrorMessage>> uploadDataErrors) { + Map<String, List<ErrorMessage>> uploadDataErrors) { if (MapUtils.isEmpty(uploadDataErrors)) { return null; } return uploadDataErrors.entrySet().stream().collect( - Collectors.toMap(entry -> entry.getKey(), entry -> mapErrorMessages(entry.getValue()))); + Collectors.toMap(entry -> entry.getKey(), entry -> mapErrorMessages(entry.getValue()))); } private static QuestionnaireValidationResultDto mapQuestionnaireValidationResult( - QuestionnaireValidationResult questionnaireValidationResult) { + QuestionnaireValidationResult questionnaireValidationResult) { if (Objects.isNull(questionnaireValidationResult) - || Objects.isNull(questionnaireValidationResult.getValidationData())) { + || Objects.isNull(questionnaireValidationResult.getValidationData())) { return null; } QuestionnaireValidationResultDto questionnaireValidationResultDto = - new QuestionnaireValidationResultDto(); + new QuestionnaireValidationResultDto(); questionnaireValidationResultDto.setValid(questionnaireValidationResult.isValid()); Set<CompositionEntityValidationDataDto> validationDataDto = new HashSet<>(); for(CompositionEntityValidationData validationData : questionnaireValidationResult.getValidationData()){ validationDataDto.add(new MapCompositionEntityValidationDataToDto().applyMapping - (validationData, CompositionEntityValidationDataDto.class)); + (validationData, CompositionEntityValidationDataDto.class)); } questionnaireValidationResultDto.setValidationData(validationDataDto); return questionnaireValidationResultDto; } - private static ComponentValidationResultDto mapcomponentValidationResult( + /*private static ComponentValidationResultDto mapcomponentValidationResult( ComponentValidationResult componentValidationResult) { if (componentValidationResult == null) { return null; @@ -115,18 +113,18 @@ public class MapValidationResponseToDto deploymentFlavorValidationResultDto.setValidationData(validationDataDto); return deploymentFlavorValidationResultDto; - } + }*/ private static List<ErrorMessageDto> mapErrorMessages(List<ErrorMessage> errorMessages) { return errorMessages == null ? null : errorMessages.stream().map( - errorMessage -> new MapErrorMessageToDto() - .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList()); + errorMessage -> new MapErrorMessageToDto() + .applyMapping(errorMessage, ErrorMessageDto.class)).collect(Collectors.toList()); } private static Collection<ErrorCodeDto> mapErrorCodes(Collection<ErrorCode> errorCodes) { return CollectionUtils.isEmpty(errorCodes) ? null : errorCodes.stream() - .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class)) - .collect(Collectors.toList()); + .map(errorCode -> new MapErrorCodeToDto().applyMapping(errorCode, ErrorCodeDto.class)) + .collect(Collectors.toList()); } @Override @@ -136,8 +134,6 @@ public class MapValidationResponseToDto target.setLicensingDataErrors(mapErrorCodes(source.getLicensingDataErrors())); target.setUploadDataErrors(mapUploadDataErrors(source.getUploadDataErrors())); target.setQuestionnaireValidationResult( - mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult())); - target.setComponentValidationResult(mapcomponentValidationResult(source.getComponentValidationResult())); - target.setDeploymentFlavorValidationResult(mapdeploymentFlavorValidationResult(source.getDeploymentFlavorValidationResult())); + mapQuestionnaireValidationResult(source.getQuestionnaireValidationResult())); } } |