summaryrefslogtreecommitdiffstats
path: root/mod/bpgenerator/src
diff options
context:
space:
mode:
authorTomasz Wrobel <tomasz.wrobel@nokia.com>2020-09-30 08:59:39 +0200
committerTomasz Wrobel <tomasz.wrobel@nokia.com>2020-10-01 13:34:19 +0200
commit43a65d7605b852140a12f1398a152dea33112d87 (patch)
tree645c867c140d241e85dd5a93b02efe3f4685f214 /mod/bpgenerator/src
parent04f13ef80c6e79d8c0b7b3fa1faeeaa0def1584e (diff)
Add useExisting property to Dmaap Feed Node in Blueprint-Generator
Issue-ID: DCAEGEN2-2460 Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com> Change-Id: Ie170ed503be3e775b05bd3acf51c19d245b85c38
Diffstat (limited to 'mod/bpgenerator/src')
-rw-r--r--mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Properties.java2
-rw-r--r--mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java2
-rw-r--r--mod/bpgenerator/src/test/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNodeTest.java22
3 files changed, 24 insertions, 2 deletions
diff --git a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Properties.java b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Properties.java
index c847f13..9aa5354 100644
--- a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Properties.java
+++ b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Properties.java
@@ -71,7 +71,7 @@ public class Properties {
private ExternalTlsInfo external_cert;
private ResourceConfig resource_config;
private GetInput always_pull_image;
- //private boolean useExisting;
+ private Boolean useExisting;
@JsonIgnore
private ExternalTlsInfoFactory externalCertFactory;
diff --git a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java
index 9069f82..515099a 100644
--- a/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java
+++ b/mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNode.java
@@ -131,7 +131,7 @@ public class DmaapNode extends Node {
GetInput topicInput = new GetInput();
topicInput.setBpInputName(name + "_name");
props.setFeed_name(topicInput);
- //props.setUseExisting(true);
+ props.setUseExisting(true);
retInputs.put(name + "_name", stringType);
this.setProperties(props);
diff --git a/mod/bpgenerator/src/test/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNodeTest.java b/mod/bpgenerator/src/test/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNodeTest.java
index 6936393..83419e5 100644
--- a/mod/bpgenerator/src/test/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNodeTest.java
+++ b/mod/bpgenerator/src/test/java/org/onap/blueprintgenerator/models/dmaapbp/DmaapNodeTest.java
@@ -21,6 +21,8 @@ package org.onap.blueprintgenerator.models.dmaapbp;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import static org.onap.blueprintgenerator.models.blueprint.BpConstants.CONTENERIZED_SERVICE_COMPONENT_USING_DMAAP;
@@ -147,6 +149,16 @@ public class DmaapNodeTest {
}
@Test
+ public void feedNodePropertiesShouldHaveUseExistingField() {
+ ComponentSpec componentSpec = getSpiedComponentSpecWithoutRelationships();
+
+ DmaapNode dmaapNode = new DmaapNode();
+ dmaapNode.createFeedNode(componentSpec, new TreeMap<>() ,"");
+
+ assertTrue(dmaapNode.getProperties().getUseExisting());
+ }
+
+ @Test
public void createTopicNodeShouldSetTopicNodeType() {
ComponentSpec componentSpec = getSpiedComponentSpecWithoutRelationships();
@@ -157,6 +169,16 @@ public class DmaapNodeTest {
assertEquals(TOPIC, dmaapNode.getType());
}
+ @Test
+ public void topicNodePropertiesShouldNotHaveUseExistingField() {
+ ComponentSpec componentSpec = getSpiedComponentSpecWithoutRelationships();
+
+ DmaapNode dmaapNode = new DmaapNode();
+ dmaapNode.createTopicNode(componentSpec, new TreeMap<>() ,"");
+
+ assertNull(dmaapNode.getProperties().getUseExisting());
+ }
+
private Publishes[] createSamplePublishes(String type) {
Publishes publishes = new Publishes();