diff options
author | niamhcore <niamh.core@est.tech> | 2021-11-10 12:13:51 +0000 |
---|---|---|
committer | niamhcore <niamh.core@est.tech> | 2021-11-10 12:28:40 +0000 |
commit | 9e09fe868b39fd5f13092a923da3474deb0f75b9 (patch) | |
tree | bf51a92447c0061a48bf0dba1bc7b1cd7e437435 /cps-ncmp-rest/src/main | |
parent | 7a9e0f81770f2aa2793e241cee3a3c6c9bb40d9d (diff) |
Fix for get cm handle identifiers response body
Issue-ID: CPS-636
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I35dabf8e5839c56a9ae1851495cc9bf15e633c21
Diffstat (limited to 'cps-ncmp-rest/src/main')
-rwxr-xr-x | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index 19b9a09daa..075b451603 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -217,8 +217,7 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { final List<ConditionProperties> conditionProperties = conditions.getConditions().stream().collect(Collectors.toList()); final CmHandles cmHandles = new CmHandles(); - final Collection<String> cmHandleIdentifiers = processConditions(conditionProperties); - cmHandleIdentifiers.forEach(cmHandle -> cmHandles.setCmHandles(toCmHandleProperties(cmHandle))); + cmHandles.setCmHandles(toCmHandleProperties(processConditions(conditionProperties))); return ResponseEntity.ok(cmHandles); } @@ -254,11 +253,13 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { return moduleNames; } - private CmHandleProperties toCmHandleProperties(final String cmHandleId) { + private CmHandleProperties toCmHandleProperties(final Collection<String> cmHandleIdentifiers) { final CmHandleProperties cmHandleProperties = new CmHandleProperties(); - final CmHandleProperty cmHandleProperty = new CmHandleProperty(); - cmHandleProperty.setCmHandleId(cmHandleId); - cmHandleProperties.add(cmHandleProperty); + for (final String cmHandleIdentifier : cmHandleIdentifiers) { + final CmHandleProperty cmHandleProperty = new CmHandleProperty(); + cmHandleProperty.setCmHandleId(cmHandleIdentifier); + cmHandleProperties.add(cmHandleProperty); + } return cmHandleProperties; } |