X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdbcapi.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fservice%2FTopicServiceTest.java;fp=src%2Ftest%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fservice%2FTopicServiceTest.java;h=f73c297c2214b1d92a2941bc0f4069dbc1922ebb;hp=33a5411d0774b371e6dbf8c54bf7be73b6262f21;hb=2d1b398cd414a71efc85913c162e2f78dfae7c06;hpb=5a9cbe16fa36ba35dc9ba104a287977e975a455b 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 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 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) {