use of org.openkilda.messaging.error.ErrorData in project open-kilda by telstra.
the class FlowTopologyTest method errorFlowSpeakerCommand.
private ErrorMessage errorFlowSpeakerCommand(final String flowId) throws IOException {
System.out.println("TOPOLOGY: Error rule");
ErrorData errorData = new ErrorData(ErrorType.REQUEST_INVALID, "Could not operate with flow", flowId);
ErrorMessage errorMessage = new ErrorMessage(errorData, 0, "error-flow", Destination.WFM_TRANSACTION);
// sendSpeakerMessage(errorMessage);
sendMessage(errorMessage, topologyConfig.getKafkaFlowTopic());
return errorMessage;
}
use of org.openkilda.messaging.error.ErrorData in project open-kilda by telstra.
the class FlowTopologyTest method getUnknownFlowTest.
@Test
public void getUnknownFlowTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
getFlow(flowId);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
ErrorMessage errorMessage = objectMapper.readValue(record.value(), ErrorMessage.class);
assertNotNull(errorMessage);
ErrorData errorData = errorMessage.getData();
assertEquals(ErrorType.NOT_FOUND, errorData.getErrorType());
}
use of org.openkilda.messaging.error.ErrorData in project open-kilda by telstra.
the class FlowTopologyTest method pathUnknownFlowTest.
@Test
public void pathUnknownFlowTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
pathFlow(flowId);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
ErrorMessage errorMessage = objectMapper.readValue(record.value(), ErrorMessage.class);
assertNotNull(errorMessage);
ErrorData errorData = errorMessage.getData();
assertEquals(ErrorType.NOT_FOUND, errorData.getErrorType());
}
Aggregations