use of org.openkilda.messaging.info.flow.FlowResponse in project open-kilda by telstra.
the class FlowTopologyTest method createFlowCommandBoltTest.
@Test
public void createFlowCommandBoltTest() throws Exception {
ConsumerRecord<String, String> record;
String flowId = UUID.randomUUID().toString();
createFlow(flowId);
record = cacheConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
InfoMessage message = objectMapper.readValue(record.value(), InfoMessage.class);
ImmutablePair<Flow, Flow> flow = getFlowPayload(message);
assertNotNull(flow);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
InfoMessage infoMessage = objectMapper.readValue(record.value(), InfoMessage.class);
FlowResponse response = (FlowResponse) infoMessage.getData();
assertNotNull(response);
}
use of org.openkilda.messaging.info.flow.FlowResponse in project open-kilda by telstra.
the class AbstractSerializerTest method flowResponseTest.
@Test
public void flowResponseTest() throws IOException, ClassNotFoundException {
FlowResponse data = new FlowResponse(flowModel);
System.out.println(data);
InfoMessage info = new InfoMessage(data, System.currentTimeMillis(), CORRELATION_ID, DESTINATION);
serialize(info);
Message message = (Message) deserialize();
assertTrue(message instanceof InfoMessage);
InfoMessage resultInfo = (InfoMessage) message;
assertTrue(resultInfo.getData() instanceof FlowResponse);
FlowResponse resultData = (FlowResponse) resultInfo.getData();
System.out.println(resultData);
assertEquals(data, resultData);
assertEquals(data.hashCode(), resultData.hashCode());
assertEquals(flowModel.hashCode(), resultData.getPayload().hashCode());
}
Aggregations