summaryrefslogtreecommitdiffstats
path: root/src/test/java
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-05-13 09:34:05 +0200
committerXue Gao <xg353y@intl.att.com>2020-05-18 10:51:30 +0000
commit061ecec6a6099ad7fb480b0fe67f6e5154f9db23 (patch)
tree7efafa09fd0b1ade0b256dc521f48e6bfa66c56f /src/test/java
parent515251fb5ce2d8f2b4ccb5bd5d3ebd46deb4d29a (diff)
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 <sebastien.determe@intl.att.com> Change-Id: I872d3c8b0336d813e1a1cf590f6c8a06cccbe230
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/onap/clamp/clds/util/drawing/SvgLoopGeneratorTest.java15
1 files changed, 11 insertions, 4 deletions
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\"");