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);
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;
assertEquals(FEED, dmaapNode.getType());
}
+ @Test
+ public void feedNodePropertiesShouldHaveUseExistingField() {
+ ComponentSpec componentSpec = getSpiedComponentSpecWithoutRelationships();
+
+ DmaapNode dmaapNode = new DmaapNode();
+ dmaapNode.createFeedNode(componentSpec, new TreeMap<>() ,"");
+
+ assertTrue(dmaapNode.getProperties().getUseExisting());
+ }
+
@Test
public void createTopicNodeShouldSetTopicNodeType() {
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();