aboutsummaryrefslogtreecommitdiffstats
path: root/common-be/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'common-be/src/test')
-rw-r--r--common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java29
1 files changed, 28 insertions, 1 deletions
diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java
index 95fe656705..899022e9ad 100644
--- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java
+++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/elements/PropertyDataDefinitionTest.java
@@ -27,7 +27,13 @@ import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import java.util.List;
-import static org.junit.Assert.*;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
public class PropertyDataDefinitionTest {
@@ -650,4 +656,25 @@ public class PropertyDataDefinitionTest {
testSubject.mergeFunction(createTestSubject(), false);
}
+
+ @Test
+ public void schemaTypeNullWhenSchemaIsNull() {
+ String sampleSchemaType = "sampleSchemaType";
+ PropertyDataDefinition testSubject = createTestSubject();
+ testSubject.setSchemaType(sampleSchemaType);
+ assertNull(testSubject.getSchemaType());
+ }
+
+ @Test
+ public void schemaTypeIsReturnedWhenSchemaisPresent() {
+ String sampleSchemaType = "sampleSchemaType";
+ SchemaDefinition schemaDefinition = new SchemaDefinition();
+ schemaDefinition.setProperty(new PropertyDataDefinition());
+
+ PropertyDataDefinition testSubject = createTestSubject();
+ testSubject.setSchema(schemaDefinition);
+ testSubject.setSchemaType(sampleSchemaType);
+
+ assertThat(testSubject.getSchemaType(), is(equalTo(sampleSchemaType)));
+ }
}