aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-dao/src/main
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2018-05-31 16:57:17 +0300
committerTal Gitelman <tg851x@intl.att.com>2018-05-31 15:24:39 +0000
commitcdb8d264670ae4b98eb3b40cc58ee06b2c2e70c9 (patch)
treed43609c24140c13f92c6d303b76820b74f8c7634 /catalog-dao/src/main
parentcc4088f4d26212b8dbeeff01f0ae2e38f2df4d3f (diff)
new unit tests for sdc-dao
Change-Id: Ibf37c20c3d07f3cd2962e324f3e37354adad9870 Issue-ID: SDC-1333 Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-dao/src/main')
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupTypeData.java8
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/PolicyTypeData.java6
-rw-r--r--catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ResourceMetadataData.java4
3 files changed, 12 insertions, 6 deletions
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupTypeData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupTypeData.java
index 87f4fcf283..3a92819231 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupTypeData.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/GroupTypeData.java
@@ -60,9 +60,11 @@ public class GroupTypeData extends GraphNode {
groupTypeDataDefinition.setType((String) properties.get(GraphPropertiesDictionary.TYPE.getProperty()));
groupTypeDataDefinition.setVersion((String) properties.get(GraphPropertiesDictionary.VERSION.getProperty()));
-
- groupTypeDataDefinition.setHighestVersion(
- (boolean) properties.get(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty()));
+
+ if (properties.get(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty()) != null) {
+ groupTypeDataDefinition.setHighestVersion(
+ (boolean) properties.get(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty()));
+ }
groupTypeDataDefinition
.setDescription((String) properties.get(GraphPropertiesDictionary.DESCRIPTION.getProperty()));
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/PolicyTypeData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/PolicyTypeData.java
index 28081cce96..8847262e87 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/PolicyTypeData.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/PolicyTypeData.java
@@ -69,8 +69,10 @@ public class PolicyTypeData extends GraphNode {
policyTypeDataDefinition
.setDescription((String) properties.get(GraphPropertiesDictionary.DESCRIPTION.getProperty()));
- policyTypeDataDefinition.setHighestVersion(
- (boolean) properties.get(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty()));
+ if (properties.get(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty()) != null) {
+ policyTypeDataDefinition.setHighestVersion(
+ (boolean) properties.get(GraphPropertiesDictionary.IS_HIGHEST_VERSION.getProperty()));
+ }
policyTypeDataDefinition.setVersion((String) properties.get(GraphPropertiesDictionary.VERSION.getProperty()));
diff --git a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ResourceMetadataData.java b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ResourceMetadataData.java
index 06e098ff4b..efb89db0da 100644
--- a/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ResourceMetadataData.java
+++ b/catalog-dao/src/main/java/org/openecomp/sdc/be/resources/data/ResourceMetadataData.java
@@ -42,7 +42,9 @@ public class ResourceMetadataData extends ComponentMetadataData {
super(NodeTypeEnum.Resource, new ResourceMetadataDataDefinition(), properties);
((ResourceMetadataDataDefinition) metadataDataDefinition).setVendorName((String) properties.get(GraphPropertiesDictionary.VENDOR_NAME.getProperty()));
((ResourceMetadataDataDefinition) metadataDataDefinition).setVendorRelease((String) properties.get(GraphPropertiesDictionary.VENDOR_RELEASE.getProperty()));
- ((ResourceMetadataDataDefinition) metadataDataDefinition).setResourceType(ResourceTypeEnum.valueOf((String) properties.get(GraphPropertiesDictionary.RESOURCE_TYPE.getProperty())));
+ if (properties.get(GraphPropertiesDictionary.RESOURCE_TYPE.getProperty()) != null) {
+ ((ResourceMetadataDataDefinition) metadataDataDefinition).setResourceType(ResourceTypeEnum.valueOf((String) properties.get(GraphPropertiesDictionary.RESOURCE_TYPE.getProperty())));
+ }
((ResourceMetadataDataDefinition) metadataDataDefinition).setAbstract((Boolean) properties.get(GraphPropertiesDictionary.IS_ABSTRACT.getProperty()));
((ResourceMetadataDataDefinition) metadataDataDefinition).setCost((String) properties.get(GraphPropertiesDictionary.COST.getProperty()));
((ResourceMetadataDataDefinition) metadataDataDefinition).setLicenseType((String) properties.get(GraphPropertiesDictionary.LICENSE_TYPE.getProperty()));