summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test
diff options
context:
space:
mode:
authorTalio <tali.orenbach@amdocs.com>2019-01-31 18:00:36 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2019-02-04 11:00:09 +0000
commit0953785bfd6a3af5e506f8a55a8520c0fb7ef358 (patch)
tree2f900e3f09a60a5a9a75ddcdd30930d3164eeeed /catalog-be/src/test
parent47c8af4d7241f20755ea97a6119bae2f500cfffa (diff)
Add property mapping feature to ONAP
Add service property assignment Change-Id: I29748ce12bacab06b8bc27f8875b39d80ffe5af7 Issue-ID: SDC-1988 Signed-off-by: Talio <tali.orenbach@amdocs.com>
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java149
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/InterfaceOperationValidationTest.java2
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java116
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java10
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java13
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java10
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/test/utils/InterfaceOperationTestUtils.java3
7 files changed, 138 insertions, 165 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java
index f55f461ce9..4f2bb78079 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/PropertyBusinessLogicTest.java
@@ -23,19 +23,15 @@ package org.openecomp.sdc.be.components;
import fj.data.Either;
import org.junit.Before;
import org.junit.Test;
-import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.openecomp.sdc.be.components.impl.BaseBusinessLogic;
import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic;
import org.openecomp.sdc.be.components.validation.UserValidations;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
-import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.impl.WebAppContextWrapper;
import org.openecomp.sdc.be.model.*;
@@ -50,27 +46,18 @@ import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
import org.openecomp.sdc.exception.ResponseFormat;
+import org.openecomp.sdc.test.utils.InterfaceOperationTestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.WebApplicationContext;
+
import javax.servlet.ServletContext;
import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.runner.Request.method;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
+import java.util.*;
+
+import static org.junit.Assert.*;
+import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.when;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.*;
public class PropertyBusinessLogicTest {
@@ -89,20 +76,22 @@ public class PropertyBusinessLogicTest {
private ComponentsUtils componentsUtils;
@Mock
private ToscaOperationFacade toscaOperationFacade;
-
@Mock
private UserValidations userValidations;
-
@Mock
IGraphLockOperation graphLockOperation;
+ @Mock
+ TitanDao titanDao;
@InjectMocks
private PropertyBusinessLogic bl = new PropertyBusinessLogic();
private User user = null;
private String resourceId = "resourceforproperty.0.1";
-
- @Mock
- TitanDao titanDao;
+ private String serviceId = "serviceForProperty.0.1";
+ private static final String interfaceType = "interfaceType";
+ private static final String operationType = "operationType";
+ private static final String operationId = "operationId";
+ private static final String operationId2 = "operationId2";
@Before
public void setup() {
@@ -144,7 +133,7 @@ public class PropertyBusinessLogicTest {
resource.setUniqueId(resourceId);
Mockito.when(toscaOperationFacade.getToscaElement(resourceId)).thenReturn(Either.left(resource));
- Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> nonExistingProperty = bl.getProperty(resourceId, "NonExistingProperty", user.getUserId());
+ Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> nonExistingProperty = bl.getComponentProperty(resourceId, "NonExistingProperty", user.getUserId());
assertTrue(nonExistingProperty.isRight());
Mockito.verify(componentsUtils).getResponseFormat(ActionStatus.PROPERTY_NOT_FOUND, "");
}
@@ -158,7 +147,7 @@ public class PropertyBusinessLogicTest {
resource.setUniqueId(resourceId);
Mockito.when(toscaOperationFacade.getToscaElement(resourceId)).thenReturn(Either.left(resource));
- Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> notFoundProperty = bl.getProperty(resourceId, "invalidId", user.getUserId());
+ Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> notFoundProperty = bl.getComponentProperty(resourceId, "invalidId", user.getUserId());
assertTrue(notFoundProperty.isRight());
Mockito.verify(componentsUtils).getResponseFormat(ActionStatus.PROPERTY_NOT_FOUND, "");
}
@@ -171,11 +160,105 @@ public class PropertyBusinessLogicTest {
resource.setProperties(Arrays.asList(property1));
Mockito.when(toscaOperationFacade.getToscaElement(resourceId)).thenReturn(Either.left(resource));
- Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> foundProperty = bl.getProperty(resourceId, property1.getUniqueId(), user.getUserId());
+ Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> foundProperty = bl.getComponentProperty(resourceId, property1.getUniqueId(), user.getUserId());
assertTrue(foundProperty.isLeft());
assertEquals(foundProperty.left().value().getValue().getUniqueId(), property1.getUniqueId());
}
+ @Test
+ public void testGetPropertyFromService() {
+ Service service = new Service();
+ service.setUniqueId(serviceId);
+
+ PropertyDefinition property1 = createPropertyObject("someProperty", null);
+ service.setProperties(Arrays.asList(property1));
+
+ Mockito.when(toscaOperationFacade.getToscaElement(serviceId)).thenReturn(Either.left(service));
+ Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> serviceProperty =
+ bl.getComponentProperty(serviceId, property1.getUniqueId(), user.getUserId());
+
+ assertTrue(serviceProperty.isLeft());
+ assertEquals(serviceProperty.left().value().getValue().getUniqueId(), property1.getUniqueId());
+ }
+
+ @Test
+ public void testPropertyNotFoundOnService() {
+ Service service = new Service();
+ service.setUniqueId(serviceId);
+
+ PropertyDefinition property1 = createPropertyObject("someProperty", null);
+ service.setProperties(Arrays.asList(property1));
+
+ Mockito.when(toscaOperationFacade.getToscaElement(serviceId)).thenReturn(Either.left(service));
+ Either<Map.Entry<String, PropertyDefinition>, ResponseFormat> serviceProperty =
+ bl.getComponentProperty(serviceId, "notExistingPropId", user.getUserId());
+
+ assertTrue(serviceProperty.isRight());
+ }
+
+ @Test
+ public void isPropertyUsedByComponentInterface(){
+ Service service = new Service();
+ service.setUniqueId(serviceId);
+ service.setInterfaces(InterfaceOperationTestUtils.createMockInterfaceDefinitionMap(interfaceType, operationId, operationType));
+
+ PropertyDefinition propDef1 = new PropertyDefinition();
+ propDef1.setUniqueId("ComponentInput1_uniqueId");
+ assertTrue(bl.isPropertyUsedByOperation(service, propDef1));
+
+ PropertyDefinition propDef2 = new PropertyDefinition();
+ propDef1.setUniqueId("inputId2");
+ Mockito.when(toscaOperationFacade.getParentComponents(serviceId)).thenReturn(Either.left(new ArrayList<>()));
+ assertFalse(bl.isPropertyUsedByOperation(service, propDef2));
+ }
+
+ @Test
+ public void isPropertyUsedByComponentInstanceInterface(){
+ Map<String, InterfaceDefinition> newInterfaceDefinition = InterfaceOperationTestUtils.createMockInterfaceDefinitionMap(interfaceType, operationId, operationType);
+ ComponentInstanceInterface componentInstanceInterface = new ComponentInstanceInterface(interfaceType, newInterfaceDefinition.get(interfaceType));
+
+ Map<String, List<ComponentInstanceInterface>> componentInstanceInterfaces = new HashMap<>();
+ componentInstanceInterfaces.put("Test", Arrays.asList(componentInstanceInterface));
+
+ Service service = new Service();
+ service.setUniqueId(serviceId);
+ service.setComponentInstancesInterfaces(componentInstanceInterfaces);
+
+ PropertyDefinition propDef1 = new PropertyDefinition();
+ propDef1.setUniqueId("ComponentInput1_uniqueId");
+ assertTrue(bl.isPropertyUsedByOperation(service, propDef1));
+
+ PropertyDefinition propDef2 = new PropertyDefinition();
+ propDef1.setUniqueId("inputId2");
+ Mockito.when(toscaOperationFacade.getParentComponents(serviceId)).thenReturn(Either.left(new ArrayList<>()));
+ assertFalse(bl.isPropertyUsedByOperation(service, propDef2));
+ }
+
+ @Test
+ public void isPropertyUsedByComponentParentComponentInstanceInterface(){
+ Map<String, InterfaceDefinition> newInterfaceDefinition = InterfaceOperationTestUtils.createMockInterfaceDefinitionMap(interfaceType, operationId, operationType);
+ ComponentInstanceInterface componentInstanceInterface = new ComponentInstanceInterface(interfaceType, newInterfaceDefinition.get(interfaceType));
+
+ Map<String, List<ComponentInstanceInterface>> componentInstanceInterfaces = new HashMap<>();
+ componentInstanceInterfaces.put("Test", Arrays.asList(componentInstanceInterface));
+
+ Service parentService = new Service();
+ parentService.setComponentInstancesInterfaces(componentInstanceInterfaces);
+ Service childService = new Service();
+ childService.setUniqueId(serviceId);
+
+ PropertyDefinition propDef1 = new PropertyDefinition();
+ propDef1.setUniqueId("ComponentInput1_uniqueId");
+ Mockito.when(toscaOperationFacade.getParentComponents(serviceId)).thenReturn(Either.left(Arrays.asList(parentService)));
+ assertTrue(bl.isPropertyUsedByOperation(childService, propDef1));
+
+ PropertyDefinition propDef2 = new PropertyDefinition();
+ propDef1.setUniqueId("inputId2");
+ Mockito.when(toscaOperationFacade.getParentComponents(serviceId)).thenReturn(Either.left(new ArrayList<>()));
+ assertFalse(bl.isPropertyUsedByOperation(childService, propDef2));
+ }
+
+
private PropertyDefinition createPropertyObject(String propertyName, String resourceId) {
PropertyDefinition pd = new PropertyDefinition();
pd.setConstraints(null);
@@ -193,7 +276,8 @@ public class PropertyBusinessLogicTest {
public void deleteProperty_CONNECTION_FAILURE() {
StorageOperationStatus lockResult = StorageOperationStatus.CONNECTION_FAILURE;
when(graphLockOperation.lockComponent(any(), any())).thenReturn(lockResult);
- assertTrue(bl.deleteProperty("resourceforproperty.0.1", "someProperty","i726").isRight());
+ when(toscaOperationFacade.getToscaElement(anyString())).thenReturn(Either.left(new Resource()));
+ assertTrue(bl.deletePropertyFromComponent("resourceforproperty.0.1", "someProperty","i726").isRight());
}
@Test
@@ -229,7 +313,7 @@ public class PropertyBusinessLogicTest {
when(toscaOperationFacade.getToscaElement("RES01")).thenReturn(toscastatus);
- assertTrue(bl.deleteProperty("RES01", "someProperty","i726").isRight());
+ assertTrue(bl.deletePropertyFromComponent("RES01", "someProperty","i726").isRight());
}
@Test
@@ -265,7 +349,7 @@ public class PropertyBusinessLogicTest {
when(toscaOperationFacade.getToscaElement("RES01")).thenReturn(toscastatus);
- assertTrue(bl.deleteProperty("RES01", "someProperty","i726").isRight());
+ assertTrue(bl.deletePropertyFromComponent("RES01", "someProperty","i726").isRight());
}
@Test
@@ -299,8 +383,9 @@ public class PropertyBusinessLogicTest {
Either<Component, StorageOperationStatus> toscastatus=Either.left(resource);
when(toscaOperationFacade.getToscaElement("RES01")).thenReturn(toscastatus);
- when(toscaOperationFacade.deletePropertyOfResource(anyObject(),anyString())).thenReturn(StorageOperationStatus.OK);
+ when(toscaOperationFacade.deletePropertyOfComponent(anyObject(),anyString())).thenReturn(StorageOperationStatus.OK);
+ when(toscaOperationFacade.getParentComponents(anyString())).thenReturn(Either.left(new ArrayList<>()));
- assertTrue(bl.deleteProperty("RES01", "PROP","USR01").isRight());
+ assertTrue(bl.deletePropertyFromComponent("RES01", "PROP","USR01").isRight());
}
}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/InterfaceOperationValidationTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/InterfaceOperationValidationTest.java
index e2d83aef29..fe1e384546 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/InterfaceOperationValidationTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/validation/InterfaceOperationValidationTest.java
@@ -337,7 +337,7 @@ public class InterfaceOperationValidationTest {
.validateInterfaceOperations(inputInterfaceDefinition, component,
component.getInterfaces().get(interfaceType1),
InterfaceOperationTestUtils.createMockInterfaceTypeMap(
- interfaceType1, operationType1), false).isRight());
+ interfaceType1, operationType1 ), false).isRight());
}
@Test
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java
deleted file mode 100644
index fe147b19a9..0000000000
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/PropertyServletTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.openecomp.sdc.be.servlets;
-
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.jettison.json.JSONObject;
-import org.junit.Test;
-import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.model.PropertyDefinition;
-
-import fj.data.Either;
-
-public class PropertyServletTest {
-
- private PropertyServlet createTestSubject() {
- return new PropertyServlet();
- }
-
-
- @Test
- public void testCreateProperty() throws Exception {
- PropertyServlet testSubject;
- String resourceId = "";
- String data = "";
- HttpServletRequest request = null;
- String userId = "";
- Response result;
-
- // default test
- testSubject = createTestSubject();
- }
-
-
- @Test
- public void testGetProperty() throws Exception {
- PropertyServlet testSubject;
- String resourceId = "";
- String propertyId = "";
- HttpServletRequest request = null;
- String userId = "";
- Response result;
-
- // default test
- testSubject = createTestSubject();
- }
-
-
- @Test
- public void testDeleteProperty() throws Exception {
- PropertyServlet testSubject;
- String resourceId = "";
- String propertyId = "";
- HttpServletRequest request = null;
- String userId = "";
- Response result;
-
- // default test
- testSubject = createTestSubject();
- }
-
-
- @Test
- public void testUpdateProperty() throws Exception {
- PropertyServlet testSubject;
- String resourceId = "";
- String propertyId = "";
- String data = "";
- HttpServletRequest request = null;
- String userId = "";
- Response result;
-
- // default test
- testSubject = createTestSubject();
- }
-
-
- @Test
- public void testGetPropertyModel() throws Exception {
- PropertyServlet testSubject;
- String resourceId = "";
- String data = "";
- Either<Map<String, PropertyDefinition>, ActionStatus> result;
-
- // default test
- testSubject = createTestSubject();
- }
-
-
-
-
-
- @Test
- public void testGetPropertyDefinitionJSONObject() throws Exception {
- PropertyServlet testSubject;
- PropertyDefinition propertyDefinition = null;
- JSONObject result;
-
- // default test
- testSubject = createTestSubject();
- }
-
-
- @Test
- public void testGetPropertyBL() throws Exception {
- PropertyServlet testSubject;
- ServletContext context = null;
- PropertyBusinessLogic result;
-
- // default test
- testSubject = createTestSubject();
- }
-} \ No newline at end of file
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
index a06ba84b4e..35b8ed0278 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
@@ -37,12 +37,12 @@ public class PropertyConvertorTest {
property.setSchema(schema);
- PropertyConvertor.getInstance().convertProperty(dataTypes, property, true);
+ PropertyConvertor.getInstance().convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
}
@Test
public void convertPropertyWhenValueAndDefaultNull() {
- ToscaProperty prop = PropertyConvertor.getInstance().convertProperty(dataTypes, property, false);
+ ToscaProperty prop = PropertyConvertor.getInstance().convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
assertNotNull(prop);
assertNull(prop.getDefaultp());
}
@@ -51,7 +51,7 @@ public class PropertyConvertorTest {
public void convertPropertyWhenValueNullAndDefaultNotEmpty() {
final String def = "1";
property.setDefaultValue(def);
- ToscaProperty result = PropertyConvertor.getInstance().convertProperty(dataTypes, property, false);
+ ToscaProperty result = PropertyConvertor.getInstance().convertProperty(dataTypes, property, PropertyConvertor.PropertyType.PROPERTY);
assertNotNull(result);
assertEquals(Integer.valueOf(def), result.getDefaultp());
}
@@ -129,7 +129,7 @@ public class PropertyConvertorTest {
.setDefaultValue("::")
.setType(ToscaPropertyType.STRING.getType())
.build();
- ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, false);
+ ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, PropertyConvertor.PropertyType.PROPERTY);
assertThat(toscaProperty.getDefaultp()).isEqualTo("::");
}
@@ -139,7 +139,7 @@ public class PropertyConvertorTest {
.setDefaultValue("/")
.setType(ToscaPropertyType.STRING.getType())
.build();
- ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, false);
+ ToscaProperty toscaProperty = PropertyConvertor.getInstance().convertProperty(Collections.emptyMap(), property1, PropertyConvertor.PropertyType.PROPERTY);
assertThat(toscaProperty.getDefaultp()).isEqualTo("/");
}
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java
index 592d27ec5d..a61ea0410a 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaExportHandlerTest.java
@@ -498,6 +498,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
Component component = getNewService();
List<ComponentInstance> componentInstances = new ArrayList<>();
Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = new HashMap<>();
+ Map<String, List<ComponentInstanceProperty>> componentInstancesInterfaces = new HashMap<>();
Map<String, Component> componentCache = new HashMap<>();
Map<String, DataTypeDefinition> dataTypes = new HashMap<>();
ToscaTopolgyTemplate topologyTemplate = new ToscaTopolgyTemplate();
@@ -542,6 +543,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
componentCache.put("uid", component);
componentInstancesProperties.put("id", new ArrayList<>());
+ componentInstancesInterfaces.put("id", new ArrayList<>());
componentInstancesInputs.put("id", new ArrayList<>());
Mockito.when(capabiltyRequirementConvertor.getOriginComponent(Mockito.any(Map.class),
@@ -553,7 +555,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
// default test
result = Deencapsulation.invoke(testSubject, "convertNodeTemplates", component, componentInstances,
- componentInstancesProperties, componentCache, dataTypes, topologyTemplate);
+ componentInstancesProperties, componentInstancesInterfaces, componentCache, dataTypes, topologyTemplate);
}
@Test
@@ -561,6 +563,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
Component component = getNewResource();
List<ComponentInstance> componentInstances = new ArrayList<>();
Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = new HashMap<>();
+ Map<String, List<ComponentInstanceProperty>> componentInstancesInterfaces = new HashMap<>();
Map<String, Component> componentCache = new HashMap<>();
Map<String, DataTypeDefinition> dataTypes = new HashMap<>();
ToscaTopolgyTemplate topologyTemplate = new ToscaTopolgyTemplate();
@@ -597,7 +600,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
// default test
result = Deencapsulation.invoke(testSubject, "convertNodeTemplates", component, componentInstances,
- componentInstancesProperties, componentCache, dataTypes, topologyTemplate);
+ componentInstancesProperties, componentInstancesInterfaces, componentCache, dataTypes, topologyTemplate);
}
@Test
@@ -605,6 +608,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
Component component = getNewResource();
List<ComponentInstance> componentInstances = new ArrayList<>();
Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = new HashMap<>();
+ Map<String, List<ComponentInstanceProperty>> componentInstancesInterfaces = new HashMap<>();
Map<String, Component> componentCache = new HashMap<>();
Map<String, DataTypeDefinition> dataTypes = new HashMap<>();
ToscaTopolgyTemplate topologyTemplate = new ToscaTopolgyTemplate();
@@ -637,7 +641,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
// default test
result = Deencapsulation.invoke(testSubject, "convertNodeTemplates", component, componentInstances,
- componentInstancesProperties, componentCache, dataTypes, topologyTemplate);
+ componentInstancesProperties, componentInstancesInterfaces, componentCache, dataTypes, topologyTemplate);
}
@Test
@@ -645,6 +649,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
Component component = new Resource();
List<ComponentInstance> componentInstances = new ArrayList<>();
Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = new HashMap<>();
+ Map<String, List<ComponentInstanceProperty>> componentInstancesInterfaces = new HashMap<>();
Map<String, Component> componentCache = new HashMap<>();
Map<String, DataTypeDefinition> dataTypes = new HashMap<>();
ToscaTopolgyTemplate topologyTemplate = new ToscaTopolgyTemplate();
@@ -677,7 +682,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
// default test
result = Deencapsulation.invoke(testSubject, "convertNodeTemplates", component, componentInstances,
- componentInstancesProperties, componentCache, dataTypes, topologyTemplate);
+ componentInstancesProperties, componentInstancesInterfaces, componentCache, dataTypes, topologyTemplate);
}
@Test
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java
index 156d280a6e..fc017c8483 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/utils/InterfacesOperationsToscaUtilTest.java
@@ -122,7 +122,7 @@ public class InterfacesOperationsToscaUtilTest {
component.setInterfaces(new HashMap<>());
component.getInterfaces().put(interfaceType, addedInterface);
ToscaNodeType nodeType = new ToscaNodeType();
- addInterfaceDefinitionElement(component, nodeType, false);
+ addInterfaceDefinitionElement(component, nodeType, null, false);
ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
ToscaTemplate template = new ToscaTemplate(NODE_TYPE_NAME);
@@ -153,7 +153,7 @@ public class InterfacesOperationsToscaUtilTest {
component.setInterfaces(new HashMap<>());
component.getInterfaces().put(interfaceType, addedInterface);
ToscaNodeType nodeType = new ToscaNodeType();
- addInterfaceDefinitionElement(component, nodeType, false);
+ addInterfaceDefinitionElement(component, nodeType, null, false);
ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
ToscaTemplate template = new ToscaTemplate("testService");
@@ -183,7 +183,7 @@ public class InterfacesOperationsToscaUtilTest {
component.setInterfaces(new HashMap<>());
component.getInterfaces().put(interfaceType, addedInterface);
ToscaNodeType nodeType = new ToscaNodeType();
- addInterfaceDefinitionElement(component, nodeType, false);
+ addInterfaceDefinitionElement(component, nodeType, null, false);
ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
ToscaTemplate template = new ToscaTemplate("test");
@@ -218,7 +218,7 @@ public class InterfacesOperationsToscaUtilTest {
component.setInterfaces(new HashMap<>());
component.getInterfaces().put(addedInterfaceType, addedInterface);
ToscaNodeType nodeType = new ToscaNodeType();
- addInterfaceDefinitionElement(component, nodeType, false);
+ addInterfaceDefinitionElement(component, nodeType, null, false);
ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
ToscaTemplate template = new ToscaTemplate("test");
@@ -266,7 +266,7 @@ public class InterfacesOperationsToscaUtilTest {
component.getInterfaces().put(secondInterfaceType, secondInterface);
ToscaNodeType nodeType = new ToscaNodeType();
- addInterfaceDefinitionElement(component, nodeType, false);
+ addInterfaceDefinitionElement(component, nodeType, null,false);
ToscaExportHandler handler = new ToscaExportHandler(null,null,null,null,null,null, null);
ToscaTemplate template = new ToscaTemplate("test");
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/test/utils/InterfaceOperationTestUtils.java b/catalog-be/src/test/java/org/openecomp/sdc/test/utils/InterfaceOperationTestUtils.java
index 1cc5b56ca9..25c0d651c6 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/test/utils/InterfaceOperationTestUtils.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/test/utils/InterfaceOperationTestUtils.java
@@ -103,7 +103,7 @@ public class InterfaceOperationTestUtils {
}
public static Map<String, InterfaceDefinition> createMockInterfaceTypeMap(String interfaceType,
- String operationType) {
+ String operationType) {
Map<String, Operation> operationMap = createMockOperationTypeMap(operationType);
Map<String, InterfaceDefinition> interfaceDefinitionMap = new HashMap<>();
interfaceDefinitionMap.put(interfaceType,
@@ -118,5 +118,4 @@ public class InterfaceOperationTestUtils {
operationMap.put(operationType, operation);
return operationMap;
}
-
}