From 43a65d7605b852140a12f1398a152dea33112d87 Mon Sep 17 00:00:00 2001 From: Tomasz Wrobel Date: Wed, 30 Sep 2020 08:59:39 +0200 Subject: Add useExisting property to Dmaap Feed Node in Blueprint-Generator Issue-ID: DCAEGEN2-2460 Signed-off-by: Tomasz Wrobel Change-Id: Ie170ed503be3e775b05bd3acf51c19d245b85c38 --- .../models/dmaapbp/DmaapNodeTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'mod/bpgenerator/src/test/java/org') 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; @@ -146,6 +148,16 @@ public class DmaapNodeTest { 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() { @@ -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(); -- cgit 1.2.3-korg