1 package org.openecomp.sdc.validation.impl.validators.heatresource;
3 import org.openecomp.core.validation.types.MessageContainer;
4 import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
5 import org.openecomp.sdc.validation.impl.validators.HeatResourceValidator;
6 import org.openecomp.sdc.validation.util.ValidationTestUtil;
7 import org.testng.Assert;
8 import org.testng.annotations.Test;
10 import java.io.IOException;
14 * Created by TALIO on 2/28/2017.
16 public class ContrailNetworkPolicyResourceValidatorTest {
18 HeatResourceValidator baseValidator = new HeatResourceValidator();
19 ContrailNetworkPolicyResourceValidator resourceValidator = new
20 ContrailNetworkPolicyResourceValidator();
23 public void testNetworkPolicyAssociatedWithAttachPolicy() throws IOException {
24 Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator, resourceValidator
25 , HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource(),
26 "/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input");
28 Assert.assertNotNull(messages);
29 Assert.assertEquals(messages.size(), 1);
31 Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
33 messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
34 "WARNING: NetworkPolicy not in use, Resource Id [not_used_server_pcrf_policy]");