summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR972082IntegrationTest.java35
-rw-r--r--csarvalidation/src/test/resources/pnf/r972082/invalidYamlStructure.csarbin0 -> 18075 bytes
-rw-r--r--csarvalidation/src/test/resources/pnf/r972082/missingSourceElementUnderAttributeError.csarbin0 -> 18064 bytes
3 files changed, 35 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 fb9e431..48b2d6e 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
@@ -21,10 +21,12 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.onap.cvc.csar.cc.sol004.IntegrationTestUtils.configureTestCase;
import static org.onap.cvc.csar.cc.sol004.IntegrationTestUtils.convertToMessagesList;
+import java.net.URISyntaxException;
import java.util.List;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
+import org.onap.cli.fw.error.OnapCommandException;
import org.onap.cvc.csar.CSARArchive;
import org.onap.cvc.csar.CSARArchive.CSARError;
@@ -110,4 +112,37 @@ public class VTPValidateCSARR972082IntegrationTest {
);
}
+ @Test
+ public void shouldReportMissingSourceElementUnderAttribute() throws OnapCommandException, URISyntaxException {
+ // given
+ configureTestCase(testCase, PNF_R_972082 + "missingSourceElementUnderAttributeError.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(
+ "Missing. Entry [Source under onap_pnf_sw_information]"
+ );
+ }
+
+ @Test
+ public void shouldReportInvalidYamlStructure() throws OnapCommandException, URISyntaxException {
+ // given
+ configureTestCase(testCase, PNF_R_972082 + "invalidYamlStructure.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. Yaml file Files/pnf-sw-information/pnf-sw-information.yaml is invalid"
+ );
+ }
} \ No newline at end of file
diff --git a/csarvalidation/src/test/resources/pnf/r972082/invalidYamlStructure.csar b/csarvalidation/src/test/resources/pnf/r972082/invalidYamlStructure.csar
new file mode 100644
index 0000000..3360ce4
--- /dev/null
+++ b/csarvalidation/src/test/resources/pnf/r972082/invalidYamlStructure.csar
Binary files differ
diff --git a/csarvalidation/src/test/resources/pnf/r972082/missingSourceElementUnderAttributeError.csar b/csarvalidation/src/test/resources/pnf/r972082/missingSourceElementUnderAttributeError.csar
new file mode 100644
index 0000000..e11093c
--- /dev/null
+++ b/csarvalidation/src/test/resources/pnf/r972082/missingSourceElementUnderAttributeError.csar
Binary files differ