Interface operation feature enhancements
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / tosca / ToscaExportHandlerTest.java
index 2fabe43..592d27e 100644 (file)
@@ -1,6 +1,7 @@
 package org.openecomp.sdc.be.tosca;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -46,6 +47,7 @@ import org.openecomp.sdc.be.model.category.CategoryDefinition;
 import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
 import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
+import org.openecomp.sdc.be.model.operations.impl.InterfaceLifecycleOperation;
 import org.openecomp.sdc.be.tosca.model.SubstitutionMapping;
 import org.openecomp.sdc.be.tosca.model.ToscaCapability;
 import org.openecomp.sdc.be.tosca.model.ToscaMetadata;
@@ -82,6 +84,9 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
        @Mock
        GroupExportParserImpl groupExportParserImpl;
 
+       @Mock
+       InterfaceLifecycleOperation interfaceLifecycleOperation;
+
        @Before
        public void setUpMock() throws Exception {
                MockitoAnnotations.initMocks(this);
@@ -160,7 +165,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
                ((Resource) component).setInterfaces(new HashMap<>());
 
                Mockito.when(dataTypeCache.getAll()).thenReturn(Either.right(TitanOperationStatus.NOT_FOUND));
-
+               Mockito.when(interfaceLifecycleOperation.getAllInterfaceLifecycleTypes()).thenReturn(Either.left(Collections.emptyMap()));
                // default test when convertInterfaceNodeType is right
                result = testSubject.exportComponentInterface(component, false);
 
@@ -392,6 +397,7 @@ public class ToscaExportHandlerTest extends BeConfDependentTest {
                component.setInputs(inputs);
 
                Mockito.when(dataTypeCache.getAll()).thenReturn(Either.left(new HashMap<>()));
+               Mockito.when(interfaceLifecycleOperation.getAllInterfaceLifecycleTypes()).thenReturn(Either.left(Collections.emptyMap()));
 
                Mockito.when(capabiltyRequirementConvertor.convertRequirements(Mockito.any(Map.class), Mockito.any(Resource.class),
                                Mockito.any(ToscaNodeType.class))).thenReturn(Either.left(new ToscaNodeType()));