summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test
diff options
context:
space:
mode:
authordavsad <david.sadlier@est.tech>2021-07-24 19:40:56 +0100
committerMichael Morris <michael.morris@est.tech>2021-08-06 15:22:51 +0000
commit0ed125f98ae8ea9e80c855a640c328654660d081 (patch)
tree2ff63490ba093726164a1199aeef6605bb3652ff /catalog-model/src/test
parent84aa83e9203d6f890cc5f425a00ac748d47c5c8f (diff)
Consider component model when retrieving interface types
Issue-ID: SDC-3414 Signed-off-by: davsad <david.sadlier@est.tech> Change-Id: Ie16a2604cfdff042e32bfa4f9a3a509b5da22226
Diffstat (limited to 'catalog-model/src/test')
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java
index 0b5a7fae81..4e0d68f7e2 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/InterfaceLifecycleOperationTest.java
@@ -31,6 +31,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.junit.Assert;
import org.junit.Before;
@@ -156,9 +157,9 @@ public class InterfaceLifecycleOperationTest {
@Test
public void testGetAllInterfaceLifecycleTypes_TypesNotFound() {
- when(janusGraphGenericDao.getByCriteria(NodeTypeEnum.Interface, Collections.emptyMap(),
+ when(janusGraphGenericDao.getByCriteriaForModel(NodeTypeEnum.Interface, Collections.emptyMap(), StringUtils.EMPTY,
InterfaceData.class)).thenReturn(Either.right(JanusGraphOperationStatus.NOT_FOUND));
- Either<Map<String, InterfaceDefinition>, StorageOperationStatus> types = interfaceLifecycleOperation.getAllInterfaceLifecycleTypes();
+ Either<Map<String, InterfaceDefinition>, StorageOperationStatus> types = interfaceLifecycleOperation.getAllInterfaceLifecycleTypes(StringUtils.EMPTY);
Assert.assertEquals(types.isRight(), Boolean.TRUE);
}
@@ -173,14 +174,14 @@ public class InterfaceLifecycleOperationTest {
interfaceDataList.add(interfaceData);
Either<List<InterfaceData>, JanusGraphOperationStatus> allInterfaceTypes = Either.left(interfaceDataList);
when(janusGraphGenericDao
- .getByCriteria(NodeTypeEnum.Interface, Collections.emptyMap(), InterfaceData.class)).thenReturn(allInterfaceTypes);
+ .getByCriteriaForModel(NodeTypeEnum.Interface, Collections.emptyMap(), StringUtils.EMPTY, InterfaceData.class)).thenReturn(allInterfaceTypes);
List<ImmutablePair<OperationData, GraphEdge>> list = new ArrayList<>();
Either<List<ImmutablePair<OperationData, GraphEdge>>, JanusGraphOperationStatus> childrenNodes = Either.left(list);
when(janusGraphGenericDao.getChildrenNodes(interfaceData.getUniqueIdKey(), interfaceData.getUniqueId(), GraphEdgeLabels.INTERFACE_OPERATION, NodeTypeEnum.InterfaceOperation, OperationData.class)).thenReturn(childrenNodes);
when(janusGraphGenericDao.getParentNode(any(), any(), any(), any(), any()))
.thenReturn(Either.right(JanusGraphOperationStatus.NOT_FOUND));
- Either<Map<String, InterfaceDefinition>, StorageOperationStatus> types = interfaceLifecycleOperation.getAllInterfaceLifecycleTypes();
+ Either<Map<String, InterfaceDefinition>, StorageOperationStatus> types = interfaceLifecycleOperation.getAllInterfaceLifecycleTypes(StringUtils.EMPTY);
Assert.assertEquals(types.left().value().size(),1);
}
@@ -200,10 +201,10 @@ public class InterfaceLifecycleOperationTest {
when(janusGraphGenericDao.getParentNode(any(), any(), any(), any(), any()))
.thenReturn(Either.left(modelNode));
when(janusGraphGenericDao
- .getByCriteria(NodeTypeEnum.Interface, Collections.emptyMap(), InterfaceData.class)).thenReturn(Either.left(interfaceTypes));
+ .getByCriteriaForModel(NodeTypeEnum.Interface, Collections.emptyMap(), MODEL_NAME, InterfaceData.class)).thenReturn(Either.left(interfaceTypes));
when(janusGraphGenericDao.getChildrenNodes(interfaceData.getUniqueIdKey(), interfaceData.getUniqueId(), GraphEdgeLabels.INTERFACE_OPERATION, NodeTypeEnum.InterfaceOperation, OperationData.class)).thenReturn(Either.left(Collections.emptyList()));
- Assert.assertEquals(1, interfaceLifecycleOperation.getAllInterfaceLifecycleTypes().left().value().size());
+ Assert.assertEquals(1, interfaceLifecycleOperation.getAllInterfaceLifecycleTypes(MODEL_NAME).left().value().size());
}
}