From e66d2541cf7ee1836784681331b6909421a86d63 Mon Sep 17 00:00:00 2001 From: Bogumil Zebek Date: Fri, 26 Jul 2019 10:25:09 +0200 Subject: Option 1 - vnf only Change-Id: I281dddab930328f24b9267aa6afc6ae08fd9ed01 Issue-ID: VNFSDK-396 Signed-off-by: Zebek Bogumil --- .../VTPValidateCSARR787966IntegrationTest.java | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR787966IntegrationTest.java') diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR787966IntegrationTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR787966IntegrationTest.java index eccfe4b..d48869a 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR787966IntegrationTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/cc/sol004/VTPValidateCSARR787966IntegrationTest.java @@ -30,6 +30,7 @@ import static org.onap.cvc.csar.cc.sol004.IntegrationTestUtils.convertToMessages public class VTPValidateCSARR787966IntegrationTest { + private static final boolean IS_PNF = true; private VTPValidateCSARR787966 testCase; @Before @@ -46,7 +47,7 @@ public class VTPValidateCSARR787966IntegrationTest { public void shouldValidateProperCsar() throws Exception { // given - configureTestCase(testCase, "pnf/r787966/csar-option1-valid.csar"); + configureTestCase(testCase, "pnf/r787966/csar-option1-valid.csar", "vtp-validate-csar-r787966.yaml", IS_PNF); // when testCase.execute(); @@ -60,20 +61,40 @@ public class VTPValidateCSARR787966IntegrationTest { public void shouldReportErrorsForInvalidCsar() throws Exception { // given - configureTestCase(testCase, "pnf/r787966/csar-option1-invalid.csar"); + configureTestCase(testCase, "pnf/r787966/csar-option1-invalid.csar", "vtp-validate-csar-r787966.yaml", IS_PNF); // when testCase.execute(); // then List errors = testCase.getErrors(); - assertThat(errors.size()).isEqualTo(3); + assertThat(errors.size()).isEqualTo(4); assertThat(convertToMessagesList(errors)).contains( "Unable to find CMS section in manifest!", "Source 'Definitions/MainServiceTemplate.yaml' has wrong hash!", - "Source 'Artifacts/Other/my_script.csh' has hash, but unable to find algorithm tag!" + "Source 'Artifacts/Other/my_script.csh' has hash, but unable to find algorithm tag!", + "Source 'Artifacts/NonExisting.txt' does not exist!" ); } + @Test + public void shouldReportThanInVnfPackageCertFileWasNotDefined() throws Exception { + + // given + configureTestCase(testCase, "sample2.csar", "vtp-validate-csar-r787966.yaml", false); + + // when + testCase.execute(); + + // then + List errors = testCase.getErrors(); + assertThat(convertToMessagesList(errors)).contains( + "Unable to find cert file defined by Entry-Certificate!", + "Missing. Entry [tosca_definitions_version]" + ); + } + + + } \ No newline at end of file -- cgit 1.2.3-korg