From 061ecec6a6099ad7fb480b0fe67f6e5154f9db23 Mon Sep 17 00:00:00 2001 From: sebdet Date: Wed, 13 May 2020 09:34:05 +0200 Subject: Add info in the SVG Add two additional fields in the SVG for the UI so that components can easily get the data without the need to access the models Issue-ID: CLAMP-852 Signed-off-by: sebdet Change-Id: I872d3c8b0336d813e1a1cf590f6c8a06cccbe230 --- .../clamp/clds/util/drawing/SvgLoopGeneratorTest.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/test/java/org') diff --git a/src/test/java/org/onap/clamp/clds/util/drawing/SvgLoopGeneratorTest.java b/src/test/java/org/onap/clamp/clds/util/drawing/SvgLoopGeneratorTest.java index 9559fa17d..0150af025 100644 --- a/src/test/java/org/onap/clamp/clds/util/drawing/SvgLoopGeneratorTest.java +++ b/src/test/java/org/onap/clamp/clds/util/drawing/SvgLoopGeneratorTest.java @@ -24,12 +24,12 @@ package org.onap.clamp.clds.util.drawing; import static org.assertj.core.api.Assertions.assertThat; - import com.google.gson.JsonObject; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.junit.Test; import org.onap.clamp.loop.Loop; +import org.onap.clamp.loop.template.LoopElementModel; import org.onap.clamp.loop.template.PolicyModel; import org.onap.clamp.policy.microservice.MicroServicePolicy; import org.onap.clamp.policy.operational.OperationalPolicy; @@ -37,14 +37,17 @@ import org.xml.sax.SAXException; public class SvgLoopGeneratorTest { private Loop getLoop() { + + LoopElementModel msModel = new LoopElementModel("testMs", LoopElementModel.MICRO_SERVICE_TYPE, ""); MicroServicePolicy ms1 = new MicroServicePolicy("ms1", new PolicyModel("org.onap.ms1", "", "1.0.0", "short.ms1"), - false,null,null,null,null); + false,null,msModel,null,null); MicroServicePolicy ms2 = new MicroServicePolicy("ms2", new PolicyModel("org.onap.ms2", "", "1.0.0", "short.ms2"), - false, null,null,null,null); + false, null,msModel,null,null); + LoopElementModel opModel = new LoopElementModel("testOp", LoopElementModel.OPERATIONAL_POLICY_TYPE, ""); OperationalPolicy opPolicy = new OperationalPolicy("OperationalPolicy", new JsonObject(),new JsonObject(), - new PolicyModel("org.onap.opolicy", null, "1.0.0", "short.OperationalPolicy"), null, null, null); + new PolicyModel("org.onap.opolicy", null, "1.0.0", "short.OperationalPolicy"), opModel, null, null); Loop loop = new Loop(); loop.addMicroServicePolicy(ms1); loop.addMicroServicePolicy(ms2); @@ -66,6 +69,10 @@ public class SvgLoopGeneratorTest { assertThat(xml).contains(">VES<"); assertThat(xml).contains("data-element-id=\"ms1\""); assertThat(xml).contains("data-element-id=\"ms2\""); + assertThat(xml).contains("data-grouping-id=\"testMs\""); + assertThat(xml).contains("data-grouping-id=\"testOp\""); + assertThat(xml).contains("data-for-ui=\"testMs\""); + assertThat(xml).contains("data-for-ui=\"testOp\""); assertThat(xml).contains(">short.ms1<"); assertThat(xml).contains(">short.ms2<"); assertThat(xml).contains("data-element-id=\"OperationalPolicy\""); -- cgit 1.2.3-korg