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 NeutronPortResourceValidatorTest {
18 HeatResourceValidator baseValidator = new HeatResourceValidator();
19 NeutronPortResourceValidator resourceValidator = new NeutronPortResourceValidator();
22 public void testOnlyOneNovaPointsToOnePort() throws IOException {
23 Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
24 resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
25 "/org/openecomp/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input");
27 Assert.assertNotNull(messages);
28 Assert.assertEquals(messages.size(), 1);
30 Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
32 messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
33 "ERROR: Resource Port oam1_int_port exceed allowed relations from NovaServer");