use of org.openkilda.messaging.ctrl.RequestData in project open-kilda by telstra.
the class CacheTopologyTest method ctrlListHandler.
@Test
public void ctrlListHandler() throws Exception {
CtrlRequest request = new CtrlRequest("cachetopology/*", new RequestData("list"), 1, "list-correlation-id", Destination.WFM_CTRL);
sendMessage(request, topology.getConfig().getKafkaCtrlTopic());
ConsumerRecord<String, String> raw = ctrlConsumer.pollMessage();
// TODO: FAILED
assertNotNull(raw);
assertNotNull(raw.value());
Message responseGeneric = objectMapper.readValue(raw.value(), Message.class);
CtrlResponse response = (CtrlResponse) responseGeneric;
ResponseData payload = response.getData();
assertEquals(request.getCorrelationId(), response.getCorrelationId());
assertEquals(CacheTopology.BOLT_ID_CACHE, payload.getComponent());
}
use of org.openkilda.messaging.ctrl.RequestData in project open-kilda by telstra.
the class CacheTopologyTest method ctrlDumpHandler.
@Test
public void ctrlDumpHandler() throws Exception {
CtrlRequest request = new CtrlRequest("cachetopology/*", new RequestData("dump"), 1, "dump-correlation-id", Destination.WFM_CTRL);
sendMessage(request, topology.getConfig().getKafkaCtrlTopic());
ConsumerRecord<String, String> raw = ctrlConsumer.pollMessage();
// TODO: FAILED
assertNotNull(raw);
assertNotNull(raw.value());
Message responseGeneric = objectMapper.readValue(raw.value(), Message.class);
CtrlResponse response = (CtrlResponse) responseGeneric;
ResponseData payload = response.getData();
assertEquals(request.getCorrelationId(), response.getCorrelationId());
assertEquals(CacheTopology.BOLT_ID_CACHE, payload.getComponent());
assertTrue(payload instanceof DumpStateResponseData);
}
use of org.openkilda.messaging.ctrl.RequestData in project open-kilda by telstra.
the class FlowTopologyTest method ctrlDumpHandler.
@Test
@Ignore("Not reliable during batch run")
public void ctrlDumpHandler() throws Exception {
CtrlRequest request = new CtrlRequest("flowtopology/" + ComponentType.CRUD_BOLT.toString(), new RequestData("dump"), 1, "dump-correlation-id", Destination.WFM_CTRL);
sendMessage(request, flowTopology.getConfig().getKafkaFlowTopic());
ConsumerRecord<String, String> raw = ctrlConsumer.pollMessage();
assertNotNull(raw);
assertNotNull(raw.value());
Message responseGeneric = objectMapper.readValue(raw.value(), Message.class);
CtrlResponse response = (CtrlResponse) responseGeneric;
ResponseData payload = response.getData();
assertEquals(request.getCorrelationId(), response.getCorrelationId());
assertEquals(ComponentType.CRUD_BOLT.toString(), payload.getComponent());
assertTrue(payload instanceof DumpStateResponseData);
}
use of org.openkilda.messaging.ctrl.RequestData in project open-kilda by telstra.
the class FlowTopologyTest method sendClearState.
private void sendClearState() throws IOException, InterruptedException {
CtrlRequest request = new CtrlRequest("flowtopology/" + ComponentType.CRUD_BOLT.toString(), new RequestData("clearState"), 1, "clear-state-correlation-id", Destination.WFM_CTRL);
sendMessage(request, topologyConfig.getKafkaCtrlTopic());
ConsumerRecord<String, String> raw = ctrlConsumer.pollMessage();
assertNotNull(raw);
CtrlResponse response = (CtrlResponse) objectMapper.readValue(raw.value(), Message.class);
assertEquals(request.getCorrelationId(), response.getCorrelationId());
}
Aggregations