summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2024-02-19 18:39:37 +0000
committerdanielhanrahan <daniel.hanrahan@est.tech>2024-02-21 10:55:18 +0000
commitcbd20a33ea2414a02a3a3fba79ddc734f51e77ac (patch)
tree7172b374595478abc663019d181f395d5dceff88 /cps-ncmp-service/src/main
parentb82d45a6d32a24e6f59f0d9730a8bfe613c991ae (diff)
Add moduleSetTag when getting a CM handle
Test changes: - Check moduleSetTag (and alternateId) in unit test of get CM handle. - Verify moduleSetTag is updated in tests of CM handle upgrade. Code changes: - Set moduleSetTag when converting a YangModelCmHandle to NcmpServiceCmHandle. - Set moduleSetTag in YangModelCmHandle copy constructor. - Minor refactor using StringUtils::isBlank. Issue-ID: CPS-2027 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I6a9a92aa58d15c6ecf5a6bb21aa5c9d6ec8dc817
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java1
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java8
2 files changed, 3 insertions, 6 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java
index 3be97e8ee1..c77e9aa7a6 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java
@@ -54,6 +54,7 @@ public class YangDataConverter {
final List<YangModelCmHandle.Property> publicProperties = yangModelCmHandle.getPublicProperties();
ncmpServiceCmHandle.setCmHandleId(yangModelCmHandle.getId());
ncmpServiceCmHandle.setCompositeState(yangModelCmHandle.getCompositeState());
+ ncmpServiceCmHandle.setModuleSetTag(yangModelCmHandle.getModuleSetTag());
ncmpServiceCmHandle.setAlternateId(yangModelCmHandle.getAlternateId());
setDmiProperties(dmiProperties, ncmpServiceCmHandle);
setPublicProperties(publicProperties, ncmpServiceCmHandle);
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java
index 03e53fc427..b2758d9d5f 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java
@@ -24,7 +24,6 @@ package org.onap.cps.ncmp.api.impl.yangmodels;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.base.Strings;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -94,6 +93,7 @@ public class YangModelCmHandle {
copy.dmiProperties = original.getDmiProperties() == null ? null : new ArrayList<>(original.getDmiProperties());
copy.publicProperties =
original.getPublicProperties() == null ? null : new ArrayList<>(original.getPublicProperties());
+ copy.moduleSetTag = original.getModuleSetTag();
copy.alternateId = original.getAlternateId();
return copy;
}
@@ -134,7 +134,7 @@ public class YangModelCmHandle {
* @return dmi service name
*/
public String resolveDmiServiceName(final RequiredDmiService requiredService) {
- if (isNullEmptyOrBlank(dmiServiceName)) {
+ if (StringUtils.isBlank(dmiServiceName)) {
if (RequiredDmiService.DATA.equals(requiredService)) {
return dmiDataServiceName;
}
@@ -151,10 +151,6 @@ public class YangModelCmHandle {
return yangModelCmHandleProperties;
}
- private static boolean isNullEmptyOrBlank(final String serviceName) {
- return Strings.isNullOrEmpty(serviceName) || serviceName.isBlank();
- }
-
@AllArgsConstructor
@Data
public static class Property {