summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test/java
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2017-10-29 20:54:56 +0200
committerTal Gitelman <tg851x@intl.att.com>2017-10-29 18:55:31 +0000
commitfbd0822042a8d025d0c45d22bd2e7e5ff4f1303e (patch)
tree0ac624172c1c4e73897e194e4a3db62ed16a0d91 /catalog-be/src/test/java
parentbc51da2e2c262648993b80d27f0872bbbc4ef983 (diff)
SDC distribution failure fix
Change-Id: I508c5458afc00e57a8de517f96ec64077d660477 Issue-ID: SDC-533 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-be/src/test/java')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java29
1 files changed, 24 insertions, 5 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
index a987e0243b..c77c0f10f3 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/PropertyConvertorTest.java
@@ -7,6 +7,7 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -37,7 +38,9 @@ public class PropertyConvertorTest {
@Test
public void convertPropertyWhenValueAndDefaultNull() {
- assertNull(PropertyConvertor.getInstance().convertProperty(dataTypes, property, false));
+ ToscaProperty prop = PropertyConvertor.getInstance().convertProperty(dataTypes, property, false);
+ assertNotNull(prop);
+ assertNull(prop.getDefaultp());
}
@Test
@@ -63,7 +66,15 @@ public class PropertyConvertorTest {
resource.setProperties(properties);
Either<ToscaNodeType, ToscaError> result = PropertyConvertor.getInstance().convertProperties(resource, new ToscaNodeType(), dataTypes);
assertTrue(result.isLeft());
- assertEquals(1, result.left().value().getProperties().size());
+ assertEquals(2, result.left().value().getProperties().size());
+ int cnt = 0;
+ for (Iterator<ToscaProperty> it = result.left().value().getProperties().values().iterator(); it.hasNext(); ) {
+ ToscaProperty prop = it.next();
+ if (prop.getDefaultp() == null) {
+ cnt++;
+ }
+ }
+ assertEquals(1, cnt);
}
@Test
@@ -82,6 +93,10 @@ public class PropertyConvertorTest {
Either<ToscaNodeType, ToscaError> result = PropertyConvertor.getInstance().convertProperties(resource, new ToscaNodeType(), dataTypes);
assertTrue(result.isLeft());
assertEquals(2, result.left().value().getProperties().size());
+ for (Iterator<ToscaProperty> it = result.left().value().getProperties().values().iterator(); it.hasNext(); ) {
+ ToscaProperty prop = it.next();
+ assertNotNull(prop.getDefaultp());
+ }
}
@Test
@@ -97,6 +112,10 @@ public class PropertyConvertorTest {
resource.setProperties(properties);
Either<ToscaNodeType, ToscaError> result = PropertyConvertor.getInstance().convertProperties(resource, new ToscaNodeType(), dataTypes);
assertTrue(result.isLeft());
- assertNull(result.left().value().getProperties());
- }
-} \ No newline at end of file
+ assertEquals(2, result.left().value().getProperties().size());
+ for (Iterator<ToscaProperty> it = result.left().value().getProperties().values().iterator(); it.hasNext(); ) {
+ ToscaProperty prop = it.next();
+ assertNull(prop.getDefaultp());
+ }
+ }
+}