summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java52
1 files changed, 34 insertions, 18 deletions
diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java
index 4e6daba..bf9b094 100644
--- a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java
+++ b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR146092IntegrationTest.java
@@ -22,6 +22,7 @@ import org.junit.Test;
import org.onap.cvc.csar.CSARArchive;
import java.util.List;
+import org.onap.cvc.csar.CSARArchive.CSARError;
import static org.assertj.core.api.Assertions.assertThat;
import static org.onap.cvc.csar.cc.sol004.IntegrationTestUtils.configureTestCase;
@@ -46,53 +47,51 @@ public class VTPValidateCSARR146092IntegrationTest {
@Test
public void shouldDoNotReportErrorWhenNonManoArtifactIsNotAvailable() throws Exception {
// given
- configureTestCase(testCase, "pnf/r146092/missingNonManoArtifactInManifest.csar", "vtp-validate-csar-r146092.yaml", IS_PNF);
+ configureTestCase(testCase, "pnf/r146092/missingNonManoArtifactInManifest.csar",
+ "vtp-validate-csar-r146092.yaml", IS_PNF);
// when
testCase.execute();
// then
- List<CSARArchive.CSARError> errors = testCase.getErrors();
+ final List<CSARError> errors = testCase.getErrors();
assertThat(errors.size()).isEqualTo(0);
}
@Test
public void shouldReportThatMandatoryNonManoArtifactSetEntryHasNotAllFields() throws Exception {
// given
- configureTestCase(testCase, "pnf/r146092/missingFieldsInNonManoArtifactManifest.csar", "vtp-validate-csar-r146092.yaml", IS_PNF);
+ configureTestCase(testCase, "pnf/r146092/missingFieldsInNonManoArtifactManifest.csar",
+ "vtp-validate-csar-r146092.yaml", IS_PNF);
// when
testCase.execute();
// then
- List<CSARArchive.CSARError> errors = testCase.getErrors();
- assertThat(errors.size()).isEqualTo(4);
+ final List<CSARError> errors = testCase.getErrors();
+ assertThat(errors.size()).isEqualTo(1);
assertThat(convertToMessagesList(errors)).contains(
- "Missing. Entry [onap_ves_events]",
- "Missing. Entry [onap_pm_dictionary]",
- "Missing. Entry [onap_yang_modules]",
- "Missing. Entry [onap_others]"
+ "Missing. Entry [[onap_ansible_playbooks, onap_others, onap_pm_dictionary, onap_pnf_sw_information, onap_scripts, onap_ves_events, onap_yang_modules]]"
);
}
-
@Test
public void shouldReportThatNonManoArtifactEntryHasAnySource() throws Exception {
// given
- configureTestCase(testCase, "pnf/r146092/noSourceElementInNonManoArtifactEntryManifest.csar", "vtp-validate-csar-r146092.yaml", IS_PNF);
+ configureTestCase(testCase, "pnf/r146092/noSourceElementInNonManoArtifactEntryManifest.csar",
+ "vtp-validate-csar-r146092.yaml", IS_PNF);
// when
testCase.execute();
// then
- List<CSARArchive.CSARError> errors = testCase.getErrors();
+ final List<CSARError> errors = testCase.getErrors();
assertThat(errors.size()).isEqualTo(1);
assertThat(convertToMessagesList(errors)).contains(
- "Missing. Entry [Source under onap_ves_events]"
+ "Missing. Entry [Source under onap_ves_events]"
);
}
-
@Test
public void shouldReportThatNonManoArtifactEntryHasSourceWithUnknownFile() throws Exception {
// given
@@ -102,10 +101,10 @@ public class VTPValidateCSARR146092IntegrationTest {
testCase.execute();
// then
- List<CSARArchive.CSARError> errors = testCase.getErrors();
+ final List<CSARError> errors = testCase.getErrors();
assertThat(errors.size()).isEqualTo(1);
assertThat(convertToMessagesList(errors)).contains(
- "Invalid. Entry [Source under onap_ves_events has invalid 'Artifacts/Deployment/Events/RadioNode.yml' path]"
+ "Invalid. Entry [Source under onap_ves_events has invalid 'Artifacts/Deployment/Events/RadioNode.yml' path]"
);
}
@@ -118,10 +117,27 @@ public class VTPValidateCSARR146092IntegrationTest {
testCase.execute();
// then
- List<CSARArchive.CSARError> errors = testCase.getErrors();
+ final List<CSARError> errors = testCase.getErrors();
assertThat(errors.size()).isEqualTo(4);
assertThat(convertToMessagesList(errors)).contains(
- "Missing. Entry [Definition YAML]"
+ "Missing. Entry [Definition YAML]"
+ );
+ }
+
+ @Test
+ public void shouldReportThatEntryHasInvalidPathWhenYamlFileIsNotPresent() throws Exception {
+ // given
+ configureTestCase(testCase, "pnf/r146092/missingYamlFileReferedInSourceSessionOfManifest.csar", "vtp-validate-csar-r146092.yaml",
+ IS_PNF);
+
+ // when
+ testCase.execute();
+
+ // then
+ final List<CSARError> 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]"
);
}