summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test/java
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-01-11 19:19:05 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-01-17 10:44:23 +0000
commit035ad742f60bdb375ee4e2da4345d404949a19b4 (patch)
tree7d40e43a0d6422036403cf1f0d3bbfd3248fa61a /catalog-model/src/test/java
parentc29a4519545ff509c038c9a19781ef210b2ee14f (diff)
Improve test coverage
- extract duplicated code - remove redundant and unused code Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: I7ae3592951f53bbebf10a80f7cce22d54b2940b6 Issue-ID: SDC-4317
Diffstat (limited to 'catalog-model/src/test/java')
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperationGraphTest.java2
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java5
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/GraphTestUtils.java2
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java2
4 files changed, 5 insertions, 6 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperationGraphTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperationGraphTest.java
index b2db75933a..45cb5efb62 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperationGraphTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/NodeTemplateOperationGraphTest.java
@@ -81,7 +81,7 @@ public class NodeTemplateOperationGraphTest extends ModelTestBase {
@BeforeEach
public void before() {
- Either<JanusGraph, JanusGraphOperationStatus> graph = janusGraphDao.getGraph();
+ Either<JanusGraph, JanusGraphOperationStatus> graph = janusGraphDao.getJanusGraphClient().getGraph();
graphT = graph.left().value();
containerVertex = new GraphVertex(VertexTypeEnum.TOPOLOGY_TEMPLATE);
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java
index 29fbd755f5..28f9fc8652 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/operations/ToscaElementOperationCatalogTest.java
@@ -34,7 +34,6 @@ import org.mockito.junit.MockitoJUnitRunner;
import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus;
import org.openecomp.sdc.be.dao.janusgraph.JanusGraphDao;
import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum;
-import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum;
import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
import org.openecomp.sdc.be.model.catalog.CatalogComponent;
@@ -73,8 +72,8 @@ public class ToscaElementOperationCatalogTest {
@Before
public void setUp() {
vertexList.add(vertex);
- when(janusGraphDao.getCatalogOrArchiveVerticies(true)).thenReturn(Either.left(vertexList.iterator()));
- when(janusGraphDao.getChildVertex(vertex, EdgeLabelEnum.CATEGORY, JsonParseFlagEnum.NoParse))
+ when(janusGraphDao.getCatalogOrArchiveVertices(true)).thenReturn(Either.left(vertexList.iterator()));
+ when(janusGraphDao.getChildVertex(vertex, EdgeLabelEnum.CATEGORY))
.thenReturn(Either.right(JanusGraphOperationStatus.NOT_FOUND));
when(vertex.property(GraphPropertiesDictionary.METADATA.getProperty())).thenReturn(property);
}
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/GraphTestUtils.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/GraphTestUtils.java
index c5c01bba02..afe2dcc254 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/GraphTestUtils.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsonjanusgraph/utils/GraphTestUtils.java
@@ -97,7 +97,7 @@ public final class GraphTestUtils {
}
public static void clearGraph(JanusGraphDao janusGraphDao) {
- Either<JanusGraph, JanusGraphOperationStatus> graphResult = janusGraphDao.getGraph();
+ Either<JanusGraph, JanusGraphOperationStatus> graphResult = janusGraphDao.getJanusGraphClient().getGraph();
JanusGraph graph = graphResult.left().value();
Iterable<JanusGraphVertex> vertices = graph.query().vertices();
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java
index abb5a1888b..ce7d7d49df 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/ToscaElementLifecycleOperationTest.java
@@ -616,7 +616,7 @@ public class ToscaElementLifecycleOperationTest extends ModelTestBase {
}
private void clearGraph() {
- Either<JanusGraph, JanusGraphOperationStatus> graphResult = janusGraphDao.getGraph();
+ Either<JanusGraph, JanusGraphOperationStatus> graphResult = janusGraphDao.getJanusGraphClient().getGraph();
JanusGraph graph = graphResult.left().value();
Iterable<JanusGraphVertex> vertices = graph.query().vertices();