diff options
author | mojahidi <mojahidul.islam@amdocs.com> | 2017-11-21 11:38:41 +0530 |
---|---|---|
committer | mojahidi <mojahidul.islam@amdocs.com> | 2017-11-21 11:38:54 +0530 |
commit | 7bd878afa02d188e687a6958ae999807c2106392 (patch) | |
tree | 386429ce3dfa9bc95c766118b0aa54968289c9fd /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java | |
parent | 66ed5840294585b55bc632944f19b859d389b3d2 (diff) |
ContrailNetworkPolicy ResourceValidator
This task is about updating error messages with error codes for ContrailNetworkPolicyResourceValidator
Change-Id: Ia011acd6c82b5fee5fdfd0bca27ef527d4b3b039
Issue-ID:SDC-572
Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java')
1 files changed, 20 insertions, 4 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java index a03120c5d6..fd6f1d42bb 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java @@ -19,18 +19,34 @@ public class ContrailNetworkPolicyResourceValidatorTest { ContrailNetworkPolicyResourceValidator resourceValidator = new ContrailNetworkPolicyResourceValidator(); + private static final String PATH = "/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/"; @Test public void testNetworkPolicyAssociatedWithAttachPolicy() throws IOException { Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator, resourceValidator - , HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource(), - "/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input"); + , HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource(), + PATH + "positive"); Assert.assertNotNull(messages); Assert.assertEquals(messages.size(), 1); Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); Assert.assertEquals( - messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), - "WARNING: NetworkPolicy not in use, Resource Id [not_used_server_pcrf_policy]"); + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), + "WARNING: [HNP2]: NetworkPolicy not in use, Resource Id [not_used_server_pcrf_policy]"); + } + + @Test + public void testNonNetworkPolicyResource() throws IOException { + Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator, resourceValidator + , HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource(), + PATH + "negative"); + + Assert.assertNotNull(messages); + Assert.assertEquals(messages.size(), 1); + + Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1); + Assert.assertEquals( + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), + "WARNING: [HNP1]: NetworkPolicy not in use, Resource Id [server_pcrf_network]"); } } |