summaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main
diff options
context:
space:
mode:
authorTomasz Golabek <tomasz.golabek@nokia.com>2019-08-22 13:05:23 +0200
committerPiotr Darosz <piotr.darosz@nokia.com>2019-08-22 12:02:57 +0000
commit41ce69ec659d4fe1568bb7cfa0fd353e0469dfd4 (patch)
tree4edcaf77f9fce1c6bb5a124da8cabfda9d6b793e /catalog-dao/src/main
parent3bdedab365bf7dbc2288c988e24a97ed4823d864 (diff)
unit tests - catalog-be
Additional junit tests Change-Id: Ief7f445521f7821e47715a44c423fd11a17568e1 Issue-ID: SDC-2326 Signed-off-by: Tomasz Golabek <tomasz.golabek@nokia.com>
Diffstat (limited to 'catalog-dao/src/main')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/BatchBuilder.java31
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/Neo4jEdge.java4
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/NodeRelation.java5
3 files changed, 10 insertions, 30 deletions
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<String, List<Neo4jNode>> nodes;
- // private List<Neo4jRelation> relations;
- //
- private List<GraphElement> elements;
- // TODO add filter
+ private List<GraphElement> elements;
protected BatchBuilder() {
- // nodes = new HashMap<String, List<Neo4jNode>>();
- // relations = new ArrayList<Neo4jRelation>();
elements = new ArrayList<>();
}
@@ -52,28 +46,5 @@ public class BatchBuilder {
return elements;
}
- // public BatchBuilder add( Neo4jNode element ){
- // String label = element.getLabel();
- // List<Neo4jNode> list = nodes.get(label);
- // if ( list == null ){
- // list = new ArrayList<Neo4jNode>();
- // }
- // list.add(element);
- // nodes.put(label, list);
-
- // return this;
- // }
- // public BatchBuilder add( Neo4jRelation relation ){
- // relations.add(relation);
- // return this;
- // }
- //
- // public Map<String, List<Neo4jNode>> getNodes() {
- // return nodes;
- // }
- //
- // public List<Neo4jRelation> 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<String, Object> properties;
private ActionEnum action;
+ @VisibleForTesting
+ Neo4jEdge() {}
+
public Neo4jEdge(GraphEdgeLabels edgeType, Map<String, Object> 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;