summaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-06-02 16:15:17 +0300
committerMichael Lando <ml636r@att.com>2018-06-02 16:49:43 +0300
commit2c5e9a802d40dff290b2a7acd0db103617034038 (patch)
tree288e4c1e6984e1b6f5ed9c3fcced2941f6ee7b18 /catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java
parenta05044b3b3b91ac21d0728401c3c2f91e1bc7632 (diff)
new unit tests for sdc-dao
Change-Id: Ib5560760fe81fc0213dfca84f5be32362b41f6fe Issue-ID: SDC-1333 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java')
-rw-r--r--catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java47
1 files changed, 44 insertions, 3 deletions
diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java
index ae51f64d05..e09257d1f9 100644
--- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java
+++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java
@@ -1,9 +1,11 @@
package org.openecomp.sdc.be.dao.jsongraph;
+import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
@@ -16,7 +18,11 @@ public class GraphVertexTest {
private GraphVertex createTestSubject() {
return new GraphVertex();
}
-
+
+ @Test
+ public void testCtor() throws Exception {
+ new GraphVertex(VertexTypeEnum.ADDITIONAL_INFORMATION);
+ }
@Test
public void testGetUniqueId() throws Exception {
@@ -181,12 +187,14 @@ public class GraphVertexTest {
@Test
public void testGetJsonMetadataField() throws Exception {
GraphVertex testSubject;
- JsonPresentationFields field = null;
Object result;
// default test
testSubject = createTestSubject();
- result = testSubject.getJsonMetadataField(field);
+ result = testSubject.getJsonMetadataField(JsonPresentationFields.API_URL);
+ testSubject = createTestSubject();
+ testSubject.setType(ComponentTypeEnum.RESOURCE);
+ result = testSubject.getJsonMetadataField(JsonPresentationFields.API_URL);
}
@@ -197,5 +205,38 @@ public class GraphVertexTest {
// default test
testSubject = createTestSubject();
testSubject.updateMetadataJsonWithCurrentMetadataProperties();
+ Map<GraphPropertyEnum, Object> metadataProperties = new HashMap<>();
+ metadataProperties.put(GraphPropertyEnum.COMPONENT_TYPE, "mock");
+ testSubject.setMetadataProperties(metadataProperties );
+ testSubject.updateMetadataJsonWithCurrentMetadataProperties();
+ }
+
+ @Test
+ public void testGetType() throws Exception {
+ GraphVertex testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setType(ComponentTypeEnum.RESOURCE);
+ testSubject.getType();
+ }
+
+ @Test
+ public void testCloneData() throws Exception {
+ GraphVertex testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.cloneData(new GraphVertex());
+ }
+
+ @Test
+ public void testSetJsonMetadataField() throws Exception {
+ GraphVertex testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setJsonMetadataField(JsonPresentationFields.API_URL, "mock");
}
+
} \ No newline at end of file