From df19466321c94e4ec2c4e5ca5c8bf462602f2538 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Fri, 18 May 2018 15:52:02 +0200 Subject: Fix duplicate thresholds Fix issue detected when publishing multiple thresholds in the TCA UI Issue-ID: CLAMP-165 Change-Id: I748f145c275a9e084effee451379e8c0615201d2 Signed-off-by: Determe, Sebastien (sd378r) --- .../java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java index 35c438d9e..1478342c5 100644 --- a/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java +++ b/src/main/java/org/onap/clamp/clds/client/req/tca/TcaRequestFormatter.java @@ -157,10 +157,9 @@ public class TcaRequestFormatter { private static void addThresholds(ClampProperties refProp, String service, ObjectNode appendToNode, TcaItem tcaItem, ModelProperties modelProperties) { ArrayNode tcaNodes = appendToNode.withArray("thresholds"); - ObjectNode tcaNode; try { - tcaNode = (ObjectNode) refProp.getJsonTemplate("tca.thresholds.template", service); for (TcaThreshold tcaThreshold : tcaItem.getTcaThresholds()) { + ObjectNode tcaNode = (ObjectNode) refProp.getJsonTemplate("tca.thresholds.template", service); tcaNode.put("closedLoopControlName", modelProperties.getControlNameAndPolicyUniqueId()); tcaNode.put("fieldPath", tcaThreshold.getFieldPath()); tcaNode.put("thresholdValue", tcaThreshold.getThreshold()); -- cgit 1.2.3-korg