summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org
diff options
context:
space:
mode:
authorkaty.rotman <katy.rotman@amdocs.com>2018-02-21 10:18:53 +0200
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-02-21 14:00:36 +0000
commit4cc47ac3abe00eda7c04b9955e56dafc819e2657 (patch)
tree884ceaf250ec3b39879a28607107d6b4c46291d5 /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org
parent71331569b6e5fe1de2d2b964014f0e980364bcd0 (diff)
Heat Resource Validator code +tests
Change-Id: Ic1e10c15fbbc01580311057e71edf05506bd9e8f Issue-ID: SDC-994 Signed-off-by: katy.rotman <katy.rotman@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org')
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/VirtualMachineInterfaceValidatorTest.java43
1 files changed, 19 insertions, 24 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/VirtualMachineInterfaceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/VirtualMachineInterfaceValidatorTest.java
index c82271e1c7..d9b5f6815d 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/VirtualMachineInterfaceValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/VirtualMachineInterfaceValidatorTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.openecomp.sdc.validation.impl.validators.heatresource;
import org.openecomp.core.validation.types.MessageContainer;
@@ -69,7 +85,7 @@ public class VirtualMachineInterfaceValidatorTest {
@Test
- public void hasBothPropertiesMissingTagNegative() {
+ public void hasBothPropertiesNegativeMissingVlanTag() {
HeatResourceValidator baseValidator = new HeatResourceValidator();
VirtualMachineInterfaceValidator resourceValidator = new VirtualMachineInterfaceValidator();
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
@@ -89,7 +105,7 @@ public class VirtualMachineInterfaceValidatorTest {
}
@Test
- public void hasBothPropertiesMissingRefsNegative() {
+ public void hasBothPropertiesNegativeMissingRefs() {
HeatResourceValidator baseValidator = new HeatResourceValidator();
VirtualMachineInterfaceValidator resourceValidator = new VirtualMachineInterfaceValidator();
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
@@ -108,7 +124,7 @@ public class VirtualMachineInterfaceValidatorTest {
}
@Test
- public void hasBothPropertiesBothMissingPositiveNotVLAN() {
+ public void hasBothPropertiesBothMissingWhichMeansPositive() {
HeatResourceValidator baseValidator = new HeatResourceValidator();
VirtualMachineInterfaceValidator resourceValidator = new VirtualMachineInterfaceValidator();
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
@@ -137,27 +153,6 @@ public class VirtualMachineInterfaceValidatorTest {
}
- @Test
- public void hasSingleParentPortNegativeHasBothPropertiesNegative() {
- HeatResourceValidator baseValidator = new HeatResourceValidator();
- VirtualMachineInterfaceValidator resourceValidator = new VirtualMachineInterfaceValidator();
- Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
- resourceValidator,
- HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE.getHeatResource(),
- PATH + "vlan_mixed/negative_test/input");
-
- Assert.assertNotNull(messages);
- Assert.assertEquals(messages.size(), 1);
-
-
- Assert.assertEquals(messages.get("nested.yml").getErrorMessageList().size(), 1);
- Assert.assertEquals(
- messages.get("nested.yml").getErrorMessageList().get(0).getMessage(),
- "WARNING: [VLAN2]: VLAN Tag property " +
- "virtual_machine_interface_properties_sub_interface_vlan_tag is missing in " +
- "VLAN Resource ID [template_Vlan_2]");
-
- }
} \ No newline at end of file