diff options
author | k.kazak <k.kazak@samsung.com> | 2019-06-10 09:21:44 +0200 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2019-06-19 07:13:33 +0000 |
commit | 2a74ec311f9fc3b430a3d768195156c7b20c5e93 (patch) | |
tree | 52b144d3b302da8592ac0edc6ac60b51936822a6 /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java | |
parent | a67f45c2ab3ec438061d2bd066c8daa41b81d5bc (diff) |
fix sonar null pointer
NoveServerNamingConventionGuideLineValidator: potential null pointer fixed
Test for this use-case added
Change-Id: I3180bc6c159d1b690f0be0370abbd1fefe70045f
Issue-ID: SO-1811
Signed-off-by: k.kazak <k.kazak@samsung.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java')
1 files changed, 13 insertions, 1 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidatorTest.java index 26aad3cdf8..759b376b97 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidatorTest.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidatorTest.java @@ -73,9 +73,21 @@ public class NovaServerNamingConventionGuideLineValidatorTest { } @Test - public void testNovaImageAndFlavorNames() { + public void testNovaImageAndFlavorNamesEmptyProperties() { Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator, resourceValidator, HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(), + PATH + "heatNovaServerImageAndFlavor/negativeEmptyProperties"); + Assert.assertNotNull(messages); + Assert.assertEquals(1, messages.size()); + Assert.assertEquals(1, messages.get("first.yaml").getErrorMessageList().size()); + Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(), + "WARNING: [NNS13]: Server 'image' Parameter Name not aligned with Guidelines, Parameter Name [fsb2-image], Resource ID [FSB3]. As a result, VF/VFC Profile may miss this information"); + } + + @Test + public void testNovaImageAndFlavorNames() { + Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator, + resourceValidator, HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(), PATH + "heatNovaServerImageAndFlavor/positive"); Assert.assertNotNull(messages); Assert.assertEquals(messages.size(), 0); |