summaryrefslogtreecommitdiffstats
path: root/csarvalidation/src/test/java/org
diff options
context:
space:
mode:
authorMaciej Malewski <maciej.malewski@nokia.com>2020-07-13 12:22:05 +0200
committerBogumil Zebek <bogumil.zebek@nokia.com>2020-07-13 11:16:08 +0000
commit89e3a96553b1607fa7ab3ee9dd69150be3a75a81 (patch)
tree262ab9c3d0fc6e1c3fda74be3cc03221f1f98bbb /csarvalidation/src/test/java/org
parentacc4f065bea5608a4e812f6126c102abe8206748 (diff)
Fix validation process
Rule must check if files defined in a manifest file are available in a csar artifact. Code created by Bogumil Zebek. Issue-ID: VNFSDK-583 Signed-off-by: Maciej Malewski <maciej.malewski@nokia.com> Change-Id: I890a67bb8f62af306825f2c7d150baffac385671
Diffstat (limited to 'csarvalidation/src/test/java/org')
-rw-r--r--csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR01123IntegrationTest.java25
1 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