use of org.openkilda.floodlight.service.kafka.KafkaUtilityService in project open-kilda by telstra.
the class PingCommandTest method setUp.
@Override
@Before
public void setUp() throws Exception {
super.setUp();
FloodlightModuleConfigurationProvider provider = FloodlightModuleConfigurationProvider.of(moduleContext, KildaCore.class);
KildaCoreConfig coreConfig = provider.getConfiguration(KildaCoreConfig.class);
expect(kildaCore.getConfig()).andStubReturn(coreConfig);
moduleContext.addService(KildaCore.class, kildaCore);
moduleContext.addService(IKafkaProducerService.class, producerService);
moduleContext.addService(PingService.class, pingService);
KafkaChannel topics = createMock(KafkaChannel.class);
expect(topics.getPingTopic()).andReturn(PING_KAFKA_TOPIC).anyTimes();
KafkaUtilityService kafkaUtility = createMock(KafkaUtilityService.class);
expect(kafkaUtility.getKafkaChannel()).andReturn(topics).anyTimes();
moduleContext.addService(KafkaUtilityService.class, kafkaUtility);
producerService.sendMessageAndTrack(anyString(), capture(kafkaMessageCatcher));
expectLastCall().andVoid().anyTimes();
}
use of org.openkilda.floodlight.service.kafka.KafkaUtilityService in project open-kilda by telstra.
the class SwitchTrackingServiceTest method setUp.
@Before
public void setUp() throws Exception {
injectMocks(this);
moduleContext.addService(ISwitchManager.class, switchManager);
moduleContext.addService(FeatureDetectorService.class, featureDetector);
moduleContext.addService(IKafkaProducerService.class, producerService);
IOFSwitchService iofSwitchService = createMock(IOFSwitchService.class);
iofSwitchService.addOFSwitchListener(eq(service));
moduleContext.addService(IOFSwitchService.class, iofSwitchService);
KafkaChannel topics = createMock(KafkaChannel.class);
expect(topics.getTopoDiscoTopic()).andReturn(KAFKA_ISL_DISCOVERY_TOPIC);
expect(topics.getRegion()).andReturn("1");
KafkaUtilityService kafkaUtility = createMock(KafkaUtilityService.class);
expect(kafkaUtility.getKafkaChannel()).andReturn(topics);
moduleContext.addService(KafkaUtilityService.class, kafkaUtility);
replay(kafkaUtility, topics, iofSwitchService);
service.setup(moduleContext);
verify(iofSwitchService);
reset(kafkaUtility, topics, iofSwitchService);
}
use of org.openkilda.floodlight.service.kafka.KafkaUtilityService in project open-kilda by telstra.
the class SpeakerCommandProcessor method handleResult.
private void handleResult(SpeakerCommandRemoteReport report, String kafkaKey) {
KafkaUtilityService kafkaUtil = moduleContext.getServiceImpl(KafkaUtilityService.class);
IKafkaProducerService kafkaProducer = moduleContext.getServiceImpl(IKafkaProducerService.class);
report.reply(kafkaUtil.getKafkaChannel(), kafkaProducer, kafkaKey);
}
use of org.openkilda.floodlight.service.kafka.KafkaUtilityService in project open-kilda by telstra.
the class NetworkDiscoveryEmitterTest method setUp.
@Before
public void setUp() throws Exception {
injectMocks(this);
moduleContext.addService(IKafkaProducerService.class, kafkaProducerService);
moduleContext.addService(IPathVerificationService.class, pathVerificationService);
KafkaChannel kafkaChannel = mock(KafkaChannel.class);
expect(kafkaChannel.getTopoDiscoTopic()).andStubReturn(CONFIRMATION_TOPIC);
expect(kafkaChannel.getRegion()).andStubReturn(REGION);
KafkaUtilityService kafkaUtility = mock(KafkaUtilityService.class);
expect(kafkaUtility.getKafkaChannel()).andStubReturn(kafkaChannel);
moduleContext.addService(KafkaUtilityService.class, kafkaUtility);
}
Aggregations