diff options
Diffstat (limited to 'csarvalidation/src/test')
-rw-r--r-- | csarvalidation/src/test/java/org/onap/cvc/csar/CsarValidatorTest.java | 21 | ||||
-rw-r--r-- | csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning-2.csar | bin | 0 -> 8624 bytes |
2 files changed, 21 insertions, 0 deletions
diff --git a/csarvalidation/src/test/java/org/onap/cvc/csar/CsarValidatorTest.java b/csarvalidation/src/test/java/org/onap/cvc/csar/CsarValidatorTest.java index d742ca6..299aff2 100644 --- a/csarvalidation/src/test/java/org/onap/cvc/csar/CsarValidatorTest.java +++ b/csarvalidation/src/test/java/org/onap/cvc/csar/CsarValidatorTest.java @@ -29,6 +29,7 @@ import org.onap.cli.main.OnapCli; import java.net.URISyntaxException; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.onap.cvc.csar.cc.sol004.IntegrationTestUtils.absoluteFilePath; @@ -38,6 +39,26 @@ public class CsarValidatorTest { private static final String OPERATION_STATUS_FAILED = "FAILED"; @Test + public void shouldReportErrorAsWarningWhenErrorIsIgnored() throws URISyntaxException { + // given + OnapCliWrapper cli = new OnapCliWrapper(new String[]{ + "--product", "onap-dublin", + "csar-validate", + "--format", "json", + "--pnf", + "--csar", absoluteFilePath("pnf/r130206/csar-option1-warning-2.csar")}); + + // when + cli.handle(); + + // then + final OnapCommandResult onapCommandResult = cli.getCommandResult(); + assertTrue(onapCommandResult.getOutput().toString().contains( + "\"warnings\":[{\"vnfreqNo\":\"R130206\",\"code\":\"0x1006\",\"message\":\"Warning. Consider adding package " + + "integrity and authenticity assurance according to ETSI NFV-SOL 004 Security Option 1\",\"file\":\"\",\"lineNumber\":-1}]}")); + } + + @Test public void shouldReportThanVnfValidationFailed() throws URISyntaxException { // given OnapCliWrapper cli = new OnapCliWrapper(new String[]{ diff --git a/csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning-2.csar b/csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning-2.csar Binary files differnew file mode 100644 index 0000000..748efbb --- /dev/null +++ b/csarvalidation/src/test/resources/pnf/r130206/csar-option1-warning-2.csar |