diff options
author | 2020-12-10 14:38:00 +0100 | |
---|---|---|
committer | 2020-12-17 14:55:21 +0000 | |
commit | 1b44134b16ac74e8326ba14e1764a9023cc6f0cf (patch) | |
tree | 64e831c281abf51435d4684bca784a66355dab1f /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java | |
parent | 0b42749241b257588a74bef1804deec581d2afc2 (diff) |
Integration tests for validating PM_Dictionary.
Checking compliance content of the PM_Dictionary file against it's schema.
Issue-ID: SDC-3390
Change-Id: I8e20f977c7d6838005bc84fc6c7c8ab197152a53
Signed-off-by: Maciej Malewski <maciej.malewski@nokia.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidator.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidator.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidator.java index a91dd9f445..90270c2f7e 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidator.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidator.java @@ -41,11 +41,18 @@ public class PMDictionaryValidator { try { List<YamlDocumentValidationError> validationErrors = new YamlContentValidator().validate(fileContent); validationErrors.stream() - .map(YamlDocumentValidationError::getMessage) + .map(this::formatErrorMessage) .forEach(errors::add); } catch (Exception e) { errors.add(e.getMessage()); } return errors; } + + private String formatErrorMessage(YamlDocumentValidationError error) { + return String.format("Document number: %d, Path: %s, Message: %s", + error.getYamlDocumentNumber(), + error.getPath(), + error.getMessage()); + } } |