From: Michael Lando Date: Sat, 2 Jun 2018 13:50:20 +0000 (+0300) Subject: new unit tests for sdc-dao X-Git-Tag: v1.2.0~6 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=d582d5ef41bdfd035de7834ea275fb8593ee3308;p=sdc.git new unit tests for sdc-dao Change-Id: I5957837664a933169704c3041f9ba979f97ae1f6 Issue-ID: SDC-1333 Signed-off-by: Michael Lando --- diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphPropertiesDictionary.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphPropertiesDictionary.java index 86a171633d..6258346a40 100644 --- a/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphPropertiesDictionary.java +++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/dao/neo4j/GraphPropertiesDictionary.java @@ -20,10 +20,6 @@ package org.openecomp.sdc.be.dao.neo4j; -import java.util.ArrayList; -import java.util.List; - - public enum GraphPropertiesDictionary { // field name class type unique indexed // stored in graph index @@ -153,10 +149,10 @@ public enum GraphPropertiesDictionary { - private String property; - private Class clazz; - private boolean unique; - private boolean indexed; + private final String property; + private final Class clazz; + private final boolean unique; + private final boolean indexed; GraphPropertiesDictionary(String property,Class clazz, boolean unique,boolean indexed) { @@ -171,44 +167,15 @@ public enum GraphPropertiesDictionary { return property; } - public void setProperty(String property) { - this.property = property; - } - public Class getClazz() { return clazz; } - public void setClazz(Class clazz) { - this.clazz = clazz; - } public boolean isUnique() { return unique; } - public void setUnique(boolean unique) { - this.unique = unique; - } public boolean isIndexed() { return indexed; } - - - public void setIndexed(boolean indexed) { - this.indexed = indexed; - } - - - public static List getAllProperties() { - - List arrayList = new ArrayList(); - - for (GraphPropertiesDictionary graphProperty : GraphPropertiesDictionary - .values()) { - arrayList.add(graphProperty.getProperty()); - } - - return arrayList; - } - } diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/neo4j/GraphPropertiesDictionaryTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/neo4j/GraphPropertiesDictionaryTest.java new file mode 100644 index 0000000000..5f0fe8f40d --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/neo4j/GraphPropertiesDictionaryTest.java @@ -0,0 +1,50 @@ +package org.openecomp.sdc.be.dao.neo4j; + +import org.junit.Test; + +public class GraphPropertiesDictionaryTest { + + private GraphPropertiesDictionary createTestSubject() { + return GraphPropertiesDictionary.ADDITIONAL_INFO_ID_TO_KEY; + } + + @Test + public void testGetProperty() throws Exception { + GraphPropertiesDictionary testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProperty(); + } + + @Test + public void testGetClazz() throws Exception { + GraphPropertiesDictionary testSubject; + Class result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getClazz(); + } + + @Test + public void testIsUnique() throws Exception { + GraphPropertiesDictionary testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isUnique(); + } + + @Test + public void testIsIndexed() throws Exception { + GraphPropertiesDictionary testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isIndexed(); + } +} \ No newline at end of file