diff options
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]"); } } |