diff options
author | Bogumil Zebek <bogumil.zebek@nokia.com> | 2020-09-23 05:30:10 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-09-23 05:30:10 +0000 |
commit | e88eed4a3e6d7b9bf299d95fe2534d9f3bdbafb4 (patch) | |
tree | ac3df6baccc6daaff5c4369bf47750efafbe4d03 /csarvalidation/src/test/java | |
parent | 98d29e01adc5eb2f740803e94efd526fc89ae9c2 (diff) | |
parent | ca4c0d939cdb3bcabec2bef0636bee4aa403cee3 (diff) |
Merge "Add warnings field to oclip json response"
Diffstat (limited to 'csarvalidation/src/test/java')
-rw-r--r-- | csarvalidation/src/test/java/org/onap/cvc/csar/CsarValidatorTest.java | 21 |
1 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[]{ |