Omit tenant metadata when not set 27/133227/2
authorMichaelMorris <michael.morris@est.tech>
Fri, 10 Feb 2023 13:13:29 +0000 (13:13 +0000)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Tue, 14 Feb 2023 11:12:23 +0000 (11:12 +0000)
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Issue-ID: SDC-4384
Change-Id: I11a389efcc8327bc26831a9331220e018d296c9f

catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java

index 313bef5..245fec3 100644 (file)
@@ -583,7 +583,9 @@ public class ToscaExportHandler {
                 }
                 toscaMetadata.put(JsonPresentationFields.SUB_CATEGORY.getPresentation(), categoryDefinition.getSubcategories().get(0).getName());
                 toscaMetadata.put(JsonPresentationFields.RESOURCE_VENDOR.getPresentation(), resource.getVendorName());
-                toscaMetadata.put(JsonPresentationFields.TENANT.getPresentation(), resource.getTenant());
+                if (resource.getTenant() != null) {
+                    toscaMetadata.put(JsonPresentationFields.TENANT.getPresentation(), resource.getTenant());
+                }
                 toscaMetadata.put(JsonPresentationFields.RESOURCE_VENDOR_RELEASE.getPresentation(), resource.getVendorRelease());
                 toscaMetadata.put(JsonPresentationFields.RESOURCE_VENDOR_MODEL_NUMBER.getPresentation(), resource.getResourceVendorModelNumber());
                 break;