JSON list support when updating multiple datanodes 54/136054/1
authordanielhanrahan <daniel.hanrahan@est.tech>
Thu, 28 Sep 2023 10:13:36 +0000 (11:13 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Thu, 28 Sep 2023 10:13:36 +0000 (11:13 +0100)
commitd8620d2bceab3001543d795b3d44925377d00cf1
treeebfa0b1cb14a365488098fd96bb0ba1674b99f97
parentb4939f3dc286b23edd6f7950e74952208f983eb4
JSON list support when updating multiple datanodes

updateDataNodesAndDescendants if supplied with a JSON list such as
 {"branch": [{"name":"Name1"}, {"name":"Name2"}]}
would only replace the first node /test-tree/branch[@name='Name1'],
and ignore any remaining list items. This is caused by the use of a
legacy buildDataNode, which returns only a single DataNode from JSON,
even if the JSON contained a list.

Issue-ID: CPS-1889
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I257491b6bc3f047a64eb241eaac70fd457b24347
cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java
cps-service/src/test/groovy/org/onap/cps/api/impl/CpsDataServiceImplSpec.groovy