summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test
diff options
context:
space:
mode:
authorMichal Banka <michal.banka@nokia.com>2020-05-20 10:12:11 +0200
committerBogumil Zebek <bogumil.zebek@nokia.com>2020-05-21 07:30:21 +0000
commitdd77214f4d619637975b7ac28219446a454abc5a (patch)
treed0eda4282660dc598dcb0f50f82c8f13266a6101 /csarvalidation/src/test
parent0bb03735689b28dee661bb2d59dfc56f44cf9e2c (diff)
Add file extension checking to R972082
Change-Id: If67fce758fdeac29bbb1450892d89a424fdb7c84 Signed-off-by: Michal Banka <michal.banka@nokia.com> Issue-ID: VNFSDK-585
Diffstat (limited to 'csarvalidation/src/test')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR972082IntegrationTest.java16
-rw-r--r--csarvalidation/src/test/resources/pnf/r972082/fileExtensionOfArtifactIsNotYaml.csarbin0 -> 18061 bytes
2 files changed, 16 insertions, 0 deletions
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 66937d4..b63705b 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,6 +61,22 @@ public class VTPValidateCSARR972082IntegrationTest {
}
@Test
+ public void shouldReturnErrorWhenFileExtensionIsNotYaml() throws Exception {
+ // given
+ configureTestCase(testCase, PNF_R_972082 + "fileExtensionOfArtifactIsNotYaml.csar", VTP_VALIDATE_CSAR_R_972082_YAML, IS_PNF);
+
+ // when
+ testCase.execute();
+
+ // then
+ final List<CSARError> errors = testCase.getErrors();
+ assertThat(errors.size()).isEqualTo(1);
+ assertThat(convertToMessagesList(errors)).contains(
+ "Invalid. File extension Files/pnf-sw-information/pnf-sw-information.json is invalid"
+ );
+ }
+
+ @Test
public void shouldReturnNoErrorWhenOptionalNonManoArtifactSetEntryIsNotPresent() throws Exception {
// given
configureTestCase(testCase, PNF_R_972082 + "missingOnapPnfSwInformationArtifactSetEntry.csar",
diff --git a/csarvalidation/src/test/resources/pnf/r972082/fileExtensionOfArtifactIsNotYaml.csar b/csarvalidation/src/test/resources/pnf/r972082/fileExtensionOfArtifactIsNotYaml.csar
new file mode 100644
index 0000000..f485172
--- /dev/null
+++ b/csarvalidation/src/test/resources/pnf/r972082/fileExtensionOfArtifactIsNotYaml.csar
Binary files differ