summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004
diff options
context:
space:
mode:
authorBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-07-07 07:43:03 +0200
committerBartosz Gardziejewski <bartosz.gardziejewski@nokia.com>2020-07-07 07:45:16 +0200
commit1e579c2910080e9e7b22e57d6fcfe3a4e443bffa (patch)
tree508617648e1df1f8308fa53f3476f69f6bd4a876 /csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004
parentaecdd3fcf1f53ab957482f41d8bc64eda44ccb4f (diff)
Extend R01123 to support ZIP files
Issue-ID: VNFSDK-583 Signed-off-by: Bartosz Gardziejewski <bartosz.gardziejewski@nokia.com> Change-Id: Ie63d1ff3f38d10643bd895b5ed720997c189920a
Diffstat (limited to 'csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR01123IntegrationTest.java31
1 files changed, 31 insertions, 0 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 8f6ebbe..d08e00c 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
@@ -123,4 +123,35 @@ public class VTPValidateCSARR01123IntegrationTest {
assertThat(errors.size()).isEqualTo(0);
}
+ @Test
+ public void shouldNotReportAnyErrorWhenValidCsarIsZippedWithCmsFile() throws Exception {
+ // given
+ configureTestCase(testCase, TEST_CSAR_DIRECTORY + "csar-option2-valid-with-cms.zip", "vtp-validate-csar-r01123.yaml", IS_PNF);
+
+ // when
+ testCase.execute();
+
+ // then
+ List<CSARArchive.CSARError> errors = testCase.getErrors();
+ assertThat(errors.size()).isEqualTo(0);
+ }
+
+ @Test
+ public void shouldReportThatFileIsNotPresentInSourcesWhenInvalidCsarFileIsZippedWithCmsFile() throws Exception {
+ // given
+ configureTestCase(testCase, TEST_CSAR_DIRECTORY + "csar-option2-invalid-with-cms.zip", "vtp-validate-csar-r01123.yaml", IS_PNF);
+
+ // when
+ testCase.execute();
+
+ Condition<String> containingMissingFiles = new HamcrestCondition<>(
+ containsString("Artifacts/Informational/user_guide.txt")
+ );
+
+ // then
+ List<CSARArchive.CSARError> errors = testCase.getErrors();
+ assertThat(errors.size()).isEqualTo(1);
+ assertThat(convertToMessagesList(errors)).haveExactly(1, containingMissingFiles);
+ }
+
}