aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest
diff options
context:
space:
mode:
authoravigaffa <avi.gaffa@amdocs.com>2017-09-10 08:58:51 +0300
committeravigaffa <avi.gaffa@amdocs.com>2017-09-10 10:07:00 +0300
commit00e935fc6b8baae4d9b9ffef2c748202a60b66b4 (patch)
tree56d7b608dbb5a53022db0350f04977da8cd960f5 /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest
parent75c572279398dc2be7652263843c8802a9406c4f (diff)
Add latest bug fixes to master
Change-Id: Ieddc2330ad4e093984f14a69b52f2ca5cb465a10 Issue-ID: SDC-293 Signed-off-by: avigaffa <avi.gaffa@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest')
-rw-r--r--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.java32
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()));
}
}