summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'csarvalidation/src/test')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR01123IntegrationTest.java25
-rw-r--r--csarvalidation/src/test/resources/pnf/r01123/csar-option1-invalid-missing-files.csarbin0 -> 7189 bytes
2 files changed, 22 insertions, 3 deletions
diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR01123IntegrationTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR01123IntegrationTest.java
index d08e00c..a3112ce 100644
--- a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR01123IntegrationTest.java
+++ b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR01123IntegrationTest.java
@@ -67,7 +67,7 @@ public class VTPValidateCSARR01123IntegrationTest {
}
@Test
- public void shouldReportThatFileIsNotPresentInSources() throws Exception {
+ public void shouldReportThatFileAvailableInCsarIsNotPresentInManifestSources() throws Exception {
// given
configureTestCase(testCase, TEST_CSAR_DIRECTORY + "csar-option1-invalid-noFileInManifest.csar", "vtp-validate-csar-r01123.yaml", IS_PNF);
@@ -89,6 +89,25 @@ public class VTPValidateCSARR01123IntegrationTest {
}
@Test
+ public void shouldReportThatFilePresentInManifestIsNotPresentInCsarFile() throws Exception {
+ // given
+ configureTestCase(testCase, TEST_CSAR_DIRECTORY + "csar-option1-invalid-missing-files.csar", "vtp-validate-csar-r01123.yaml", IS_PNF);
+
+ // when
+ testCase.execute();
+
+ Condition<String> containingMissingFiles = new HamcrestCondition<>(allOf(
+ containsString("Definitions/a.yaml"),
+ containsString("Definitions/b.yaml")
+ ));
+
+ // then
+ List<CSARArchive.CSARError> errors = testCase.getErrors();
+ assertThat(errors.size()).isEqualTo(1);
+ assertThat(convertToMessagesList(errors)).haveExactly(1, containingMissingFiles);
+ }
+
+ @Test
public void shouldReportThatVendorNameIsMissingAndThatFileIsNotPresentInSource() throws Exception {
// given
configureTestCase(testCase, TEST_CSAR_DIRECTORY + "csar-option1-invalid-noVendor-noFileInManifest.csar", "vtp-validate-csar-r01123.yaml", IS_PNF);
@@ -120,7 +139,7 @@ public class VTPValidateCSARR01123IntegrationTest {
// then
List<CSARArchive.CSARError> errors = testCase.getErrors();
- assertThat(errors.size()).isEqualTo(0);
+ assertThat(errors.size()).isZero();
}
@Test
@@ -133,7 +152,7 @@ public class VTPValidateCSARR01123IntegrationTest {
// then
List<CSARArchive.CSARError> errors = testCase.getErrors();
- assertThat(errors.size()).isEqualTo(0);
+ assertThat(errors.size()).isZero();
}
@Test
diff --git a/csarvalidation/src/test/resources/pnf/r01123/csar-option1-invalid-missing-files.csar b/csarvalidation/src/test/resources/pnf/r01123/csar-option1-invalid-missing-files.csar
new file mode 100644
index 0000000..bab095d
--- /dev/null
+++ b/csarvalidation/src/test/resources/pnf/r01123/csar-option1-invalid-missing-files.csar
Binary files differ