diff options
author | talio <tali.orenbach@amdocs.com> | 2018-03-15 14:46:20 +0200 |
---|---|---|
committer | talio <tali.orenbach@amdocs.com> | 2018-03-15 16:54:28 +0200 |
commit | 8b6be264a6f4b658632b7e263737eaae92e337aa (patch) | |
tree | 6b45776c5c577c77d5da25e4764b854f2a5cfc2c /openecomp-be/lib/openecomp-tosca-lib/src/test/java | |
parent | 704247137bdba671e55c0ebde7e226fff422b608 (diff) |
Interface definition
Add separate Interface definition for node type and node template
Change-Id: I0c4446227dd096959158fd4a4741cb5aa043e495
Issue-ID: SDC-1043
Signed-off-by: talio <tali.orenbach@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/test/java')
-rw-r--r-- | openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java index 31dc3ab035..ced108380e 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java @@ -30,11 +30,13 @@ import org.openecomp.sdc.tosca.datatypes.model.Constraint; import org.openecomp.sdc.tosca.datatypes.model.Directive; import org.openecomp.sdc.tosca.datatypes.model.Import; import org.openecomp.sdc.tosca.datatypes.model.InterfaceDefinition; +import org.openecomp.sdc.tosca.datatypes.model.InterfaceDefinitionType; import org.openecomp.sdc.tosca.datatypes.model.InterfaceType; import org.openecomp.sdc.tosca.datatypes.model.NodeFilter; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.datatypes.model.NodeType; import org.openecomp.sdc.tosca.datatypes.model.OperationDefinition; +import org.openecomp.sdc.tosca.datatypes.model.OperationDefinitionType; import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; import org.openecomp.sdc.tosca.datatypes.model.PropertyType; @@ -374,8 +376,9 @@ public class ToscaModelTest { NodeTemplate nodeTemplate = DataModelUtil.getNodeTemplate(serviceTemplate, NODE_TEMPLATE_ID); - InterfaceDefinition interfaceDefinition = getInterfaceDefinition(); - Optional<Object> interfaceObj = DataModelUtil.convertInterfaceDefinitionToObj(interfaceDefinition); + InterfaceDefinitionType interfaceDefinitionType = getInterfaceDefinition(); + Optional<Object> interfaceObj = DataModelUtil.convertInterfaceDefinitionToObj( + interfaceDefinitionType); Assert.assertTrue(interfaceObj.isPresent()); Map<String, Object> interfaces = new HashMap<>(); @@ -396,13 +399,15 @@ public class ToscaModelTest { DataModelUtil.getNodeTemplate(serviceTemplateWithInterfaceDef, NODE_TEMPLATE_ID); Map<String, Object> interfaces = nodeTemplateWithInterface.getInterfaces(); Object interfaceObj = interfaces.get(INTERFACE_ID); - Optional<InterfaceDefinition> actualInterfaceDefinition = - DataModelUtil.convertObjToInterfaceDefinition(INTERFACE_ID, interfaceObj); + + Optional<? extends InterfaceDefinition> actualInterfaceDefinition = + DataModelUtil.convertObjToInterfaceDefinition(INTERFACE_ID, interfaceObj, + InterfaceDefinitionType.class); Assert.assertTrue(actualInterfaceDefinition.isPresent()); - InterfaceDefinition expectedInterfaceDefinition = getInterfaceDefinition(); - Assert.assertEquals(expectedInterfaceDefinition, actualInterfaceDefinition.get()); + InterfaceDefinitionType expectedInterfaceDefinitionType = getInterfaceDefinition(); + Assert.assertEquals(expectedInterfaceDefinitionType, actualInterfaceDefinition.get()); } @Test @@ -438,16 +443,15 @@ public class ToscaModelTest { private OperationDefinition getOperationDefinition() { OperationDefinition operationDefinition = new OperationDefinition(); operationDefinition.setDescription("start operation"); - operationDefinition.setImplementation("start.sh"); return operationDefinition; } - private InterfaceDefinition getInterfaceDefinition() { + private InterfaceDefinitionType getInterfaceDefinition() { OperationDefinition operationDefinition = getOperationDefinition(); - InterfaceDefinition interfaceDefinition = new InterfaceDefinition(); - interfaceDefinition.setType("test interface"); - interfaceDefinition.addOperation("start", operationDefinition); - return interfaceDefinition; + InterfaceDefinitionType interfaceDefinitionType = new InterfaceDefinitionType(); + interfaceDefinitionType.setType("test interface"); + interfaceDefinitionType.addOperation("start", operationDefinition); + return interfaceDefinitionType; } } |