From bdff70b07f5db50a444c49dfbce6bd0d7980e060 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sat, 2 Jun 2018 16:52:35 +0300 Subject: new unit tests for sdc-dao Change-Id: Ica0a4a0f2ca2ea0a14b97634292c4c82a63d0be6 Issue-ID: SDC-1333 Signed-off-by: Michael Lando --- .../java/org/openecomp/sdc/be/resources/data/GroupTypeData.java | 8 +++++--- .../java/org/openecomp/sdc/be/resources/data/PolicyTypeData.java | 6 ++++-- .../org/openecomp/sdc/be/resources/data/ResourceMetadataData.java | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'catalog-dao/src/main/java/org') 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())); -- cgit 1.2.3-korg