From 968d54ca133fa53a3617fae6ff30e3ff06f1805e Mon Sep 17 00:00:00 2001 From: Yuli Shlosberg Date: Thu, 19 Oct 2017 23:39:36 +0300 Subject: add more unit tests remove imports Change-Id: If2274759f929f595e63d71cc70c374268c019947 Issue-Id: SDC-467 Signed-off-by: Yuli Shlosberg (cherry picked from commit b947eb599bfab4599ce1b0c0573b1701c646e429) --- .../operations/ToscaElementOperationTest.java | 16 ++++-- .../sdc/be/model/tosca/ToscaTypeTest.java | 67 ++++++++++++++++++++++ 2 files changed, 77 insertions(+), 6 deletions(-) create mode 100644 catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java (limited to 'catalog-model/src/test/java/org') diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java index 339023f9a4..806c22a8fb 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java @@ -1,7 +1,14 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; -import org.apache.cassandra.cql3.CQL3Type; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; @@ -21,10 +28,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import java.util.*; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import fj.data.Either; /** * Created by chaya on 6/12/2017. diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java new file mode 100644 index 0000000000..0cea40fcec --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java @@ -0,0 +1,67 @@ +package org.openecomp.sdc.be.model.tosca; + +import javax.annotation.Generated; + +import org.junit.Assert; +import org.junit.Test; + + +public class ToscaTypeTest { + + private ToscaType createTestSubject() { + return ToscaType.BOOLEAN; + } + + + @Test + public void testFromYamlTypeName() throws Exception { + String typeName = ""; + ToscaType result; + + // test 1 + typeName = null; + result = ToscaType.fromYamlTypeName(typeName); + Assert.assertEquals(null, result); + + // test 2 + typeName = ""; + result = ToscaType.fromYamlTypeName(typeName); + Assert.assertEquals(null, result); + } + + + @Test + public void testIsValidValue() throws Exception { + ToscaType testSubject; + String value = ""; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isValidValue(value); + } + + + + @Test + public void testConvert() throws Exception { + ToscaType testSubject; + String value = ""; + Object result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convert(value); + } + + + @Test + public void testToString() throws Exception { + ToscaType testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +} \ No newline at end of file -- cgit 1.2.3-korg