summaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-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();