diff options
author | pkaras <piotr.karas@nokia.com> | 2019-06-04 10:46:47 +0200 |
---|---|---|
committer | pkaras <piotr.karas@nokia.com> | 2019-06-04 10:46:47 +0200 |
commit | 2d1b398cd414a71efc85913c162e2f78dfae7c06 (patch) | |
tree | 203b534fce8dfdaa5e92bc56943e0023eda62ee4 /src/test/java | |
parent | 5a9cbe16fa36ba35dc9ba104a287977e975a455b (diff) |
AafTopicSetupService used in TopicService
Change-Id: I278c3cc941bc526a776b0c988ac6a8f35f0c8925
Issue-ID: DMAAP-1211
Signed-off-by: piotr.karas <piotr.karas@nokia.com>
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/onap/dmaap/dbcapi/service/TopicServiceTest.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/java/org/onap/dmaap/dbcapi/service/TopicServiceTest.java b/src/test/java/org/onap/dmaap/dbcapi/service/TopicServiceTest.java index 33a5411..f73c297 100644 --- a/src/test/java/org/onap/dmaap/dbcapi/service/TopicServiceTest.java +++ b/src/test/java/org/onap/dmaap/dbcapi/service/TopicServiceTest.java @@ -48,6 +48,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertThat; import static org.mockito.BDDMockito.given; +import static org.mockito.Matchers.any; import static org.mockito.Mockito.verifyZeroInteractions; import static org.onap.dmaap.dbcapi.model.ReplicationType.REPLICATION_GLOBAL_TO_FQDN; @@ -67,10 +68,13 @@ public class TopicServiceTest { private DcaeLocationService locations; @Mock private MirrorMakerService bridge; + @Mock + private AafTopicSetupService aafTopicSetupService; @Before public void setUp() throws Exception { given(dmaapConfig.getProperty("MR.globalHost", "global.host.not.set")).willReturn(GLOBAL_MR_HOST); + given(aafTopicSetupService.aafTopicSetup(any(Topic.class))).willReturn(new ApiError(200, "OK")); createTopicService(); } @@ -78,7 +82,7 @@ public class TopicServiceTest { public void getTopics_shouldReturnTopicsReceivedDuringServiceCreation() { ImmutableMap<String, Topic> topics = ImmutableMap.of(TOPIC_FQTN, new Topic()); - topicService = new TopicService(topics, clientService, dmaapConfig, clusters, locations, bridge); + topicService = new TopicService(topics, clientService, dmaapConfig, clusters, locations, bridge, aafTopicSetupService); assertEquals(topics, topicService.getTopics()); } @@ -217,7 +221,7 @@ public class TopicServiceTest { private void createTopicService() { Map<String, Topic> mrTopics = new HashMap<>(); mrTopics.put(TOPIC_FQTN, createTopic(TOPIC_FQTN)); - topicService = new TopicService(mrTopics, clientService, dmaapConfig, clusters, locations, bridge); + topicService = new TopicService(mrTopics, clientService, dmaapConfig, clusters, locations, bridge, aafTopicSetupService); } private Topic createTopic(String fqtn) { |