aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/backend')
-rw-r--r--openecomp-be/backend/openecomp-sdc-validation-manager/src/test/java/org/openecomp/sdc/validation/util/ValidationManagerUtilTest.java2
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidator.java9
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidatorTest.java4
3 files changed, 11 insertions, 4 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/test/java/org/openecomp/sdc/validation/util/ValidationManagerUtilTest.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/test/java/org/openecomp/sdc/validation/util/ValidationManagerUtilTest.java
index b151ea2e8b..a5fa97566b 100644
--- a/openecomp-be/backend/openecomp-sdc-validation-manager/src/test/java/org/openecomp/sdc/validation/util/ValidationManagerUtilTest.java
+++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/test/java/org/openecomp/sdc/validation/util/ValidationManagerUtilTest.java
@@ -58,4 +58,4 @@ public class ValidationManagerUtilTest {
assertEquals(errors.get(SdcCommon.MANIFEST_NAME).get(0).getMessage(), "Manifest doesn't exist");
}
-} \ No newline at end of file
+}
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());
+ }
}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidatorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidatorTest.java
index 22ef7720dc..1aec5570a2 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidatorTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/csar/validation/PMDictionaryValidatorTest.java
@@ -58,7 +58,7 @@ class PMDictionaryValidatorTest {
// then
assertThat(errors.size(), is(1));
- assertThat(errors.get(0), is("Key not found: pmDictionaryHeader"));
+ assertThat(errors.get(0), is("Document number: 1, Path: /pmDictionary/, Message: Key not found: pmDictionaryHeader"));
}
@Test
@@ -74,4 +74,4 @@ class PMDictionaryValidatorTest {
assertThat(errors.size(), is(1));
assertThat(errors.get(0), is("PM_Dictionary YAML file is empty"));
}
-} \ No newline at end of file
+}