From 41ce69ec659d4fe1568bb7cfa0fd353e0469dfd4 Mon Sep 17 00:00:00 2001 From: Tomasz Golabek Date: Thu, 22 Aug 2019 13:05:23 +0200 Subject: unit tests - catalog-be Additional junit tests Change-Id: Ief7f445521f7821e47715a44c423fd11a17568e1 Issue-ID: SDC-2326 Signed-off-by: Tomasz Golabek --- .../openecomp/sdc/be/dao/neo4j/BatchBuilder.java | 31 +--------------------- .../org/openecomp/sdc/be/dao/neo4j/Neo4jEdge.java | 4 +++ .../openecomp/sdc/be/dao/neo4j/NodeRelation.java | 5 ++++ 3 files changed, 10 insertions(+), 30 deletions(-) (limited to 'catalog-dao/src/main/java') diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/BatchBuilder.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/BatchBuilder.java index 9d30c20683..a13c23140e 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/BatchBuilder.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/BatchBuilder.java @@ -26,16 +26,10 @@ import java.util.ArrayList; import java.util.List; public class BatchBuilder { - // private Map> nodes; - // private List relations; - // - private List elements; - // TODO add filter + private List elements; protected BatchBuilder() { - // nodes = new HashMap>(); - // relations = new ArrayList(); elements = new ArrayList<>(); } @@ -52,28 +46,5 @@ public class BatchBuilder { return elements; } - // public BatchBuilder add( Neo4jNode element ){ - // String label = element.getLabel(); - // List list = nodes.get(label); - // if ( list == null ){ - // list = new ArrayList(); - // } - // list.add(element); - // nodes.put(label, list); - - // return this; - // } - // public BatchBuilder add( Neo4jRelation relation ){ - // relations.add(relation); - // return this; - // } - // - // public Map> getNodes() { - // return nodes; - // } - // - // public List getRelations() { - // return relations; - // } } diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/Neo4jEdge.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/Neo4jEdge.java index bdd17b6512..3e2cf9c8d4 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/Neo4jEdge.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/Neo4jEdge.java @@ -20,6 +20,7 @@ package org.openecomp.sdc.be.dao.neo4j; +import com.google.common.annotations.VisibleForTesting; import org.openecomp.sdc.be.dao.graph.datatype.ActionEnum; import java.util.Map; @@ -30,6 +31,9 @@ public class Neo4jEdge { private Map properties; private ActionEnum action; + @VisibleForTesting + Neo4jEdge() {} + public Neo4jEdge(GraphEdgeLabels edgeType, Map properties, ActionEnum actionEnum) { super(); this.edgeType = edgeType; diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/NodeRelation.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/NodeRelation.java index c1402f402f..089bbdbba3 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/NodeRelation.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/NodeRelation.java @@ -20,12 +20,17 @@ package org.openecomp.sdc.be.dao.neo4j; +import com.google.common.annotations.VisibleForTesting; + public class NodeRelation { private int fromIndex; private int toIndex; private Neo4jEdge edge; + @VisibleForTesting + NodeRelation() {} + public NodeRelation(int fromIndex, int toIndex, Neo4jEdge edge) { super(); this.fromIndex = fromIndex; -- cgit 1.2.3-korg