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;
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();
}
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());
}
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) {