From 497835a9faf9ec947af69a8e1c48f02ce7376fcd Mon Sep 17 00:00:00 2001 From: Michal Banka Date: Fri, 15 May 2020 14:45:42 +0200 Subject: Fix R972082 bug Fixed bug that was showing errors during validation of CSAR, when any other non_mano_artifact_set than onap_pnf_sw_information was present in manifest file. Change-Id: Iebf4f586c3069bc8c22796ec0f809fc95e561159 Signed-off-by: Michal Banka Issue-ID: VNFSDK-585 --- .../VTPValidateCSARR972082IntegrationTest.java | 21 +++++++++------------ ...issingOnapPnfSwInformationArtifactSetEntry.csar | Bin 0 -> 116517 bytes 2 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 csarvalidation/src/test/resources/pnf/r972082/missingOnapPnfSwInformationArtifactSetEntry.csar (limited to 'csarvalidation/src/test') diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR972082IntegrationTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR972082IntegrationTest.java index 48b2d6e..66937d4 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR972082IntegrationTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR972082IntegrationTest.java @@ -61,28 +61,25 @@ public class VTPValidateCSARR972082IntegrationTest { } @Test - public void shouldReportThatEntryHasInvalidPathWhenYamlFileIsNotPresent() throws Exception { + public void shouldReturnNoErrorWhenOptionalNonManoArtifactSetEntryIsNotPresent() throws Exception { // given - configureTestCase(testCase, PNF_R_972082 + "missingYamlFileReferedInSourceSessionOfManifest.csar", - VTP_VALIDATE_CSAR_R_972082_YAML, - IS_PNF); + configureTestCase(testCase, PNF_R_972082 + "missingOnapPnfSwInformationArtifactSetEntry.csar", + VTP_VALIDATE_CSAR_R_972082_YAML, IS_PNF); // when testCase.execute(); // then final List errors = testCase.getErrors(); - assertThat(errors.size()).isEqualTo(1); - assertThat(convertToMessagesList(errors)).contains( - "Invalid. Entry [Source under onap_pnf_sw_information has invalid 'Files/pnf-sw-information/pnf-sw-information.yaml' path]" - ); + assertThat(errors.size()).isEqualTo(0); } @Test - public void shouldReportThatMandatoryNonManoArtifactSetEntryHasNotAllFields_() throws Exception { + public void shouldReportThatEntryHasInvalidPathWhenYamlFileIsNotPresent() throws Exception { // given - configureTestCase(testCase, PNF_R_972082 + "missingFieldsInNonManoArtifactManifest.csar", - VTP_VALIDATE_CSAR_R_972082_YAML, IS_PNF); + configureTestCase(testCase, PNF_R_972082 + "missingYamlFileReferedInSourceSessionOfManifest.csar", + VTP_VALIDATE_CSAR_R_972082_YAML, + IS_PNF); // when testCase.execute(); @@ -91,7 +88,7 @@ public class VTPValidateCSARR972082IntegrationTest { final List errors = testCase.getErrors(); assertThat(errors.size()).isEqualTo(1); assertThat(convertToMessagesList(errors)).contains( - "Missing. Entry [[onap_pnf_sw_information]]" + "Invalid. Entry [Source under onap_pnf_sw_information has invalid 'Files/pnf-sw-information/pnf-sw-information.yaml' path]" ); } diff --git a/csarvalidation/src/test/resources/pnf/r972082/missingOnapPnfSwInformationArtifactSetEntry.csar b/csarvalidation/src/test/resources/pnf/r972082/missingOnapPnfSwInformationArtifactSetEntry.csar new file mode 100644 index 0000000..518aaa8 Binary files /dev/null and b/csarvalidation/src/test/resources/pnf/r972082/missingOnapPnfSwInformationArtifactSetEntry.csar differ -- cgit 1.2.3-korg