use of org.openkilda.messaging.error.ErrorData in project open-kilda by telstra.
the class FlowTopologyTest method statusUnknownFlowTest.
@Test
public void statusUnknownFlowTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
statusFlow(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 updateUnknownFlowCommandBoltTest.
@Test
public void updateUnknownFlowCommandBoltTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
updateFlow(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 deleteUnknownFlowCommandBoltTest.
@Test
public void deleteUnknownFlowCommandBoltTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
deleteFlow(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 errorFlowDeleteMessageStatusBoltTopologyEngineBoltTest.
@Test
public void errorFlowDeleteMessageStatusBoltTopologyEngineBoltTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
createFlow(flowId);
record = cacheConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
deleteFlow(flowId);
record = cacheConsumer.pollMessage();
assertNotNull(record);
InfoMessage message = objectMapper.readValue(record.value(), InfoMessage.class);
assertNotNull(message);
ImmutablePair<Flow, Flow> flow = getFlowPayload(message);
assertNotNull(flow);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
statusFlow(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());
errorFlowTopologyEngineCommand(flowId, ErrorType.DELETION_FAILURE);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
errorMessage = objectMapper.readValue(record.value(), ErrorMessage.class);
assertNotNull(errorMessage);
errorData = errorMessage.getData();
assertEquals(ErrorType.DELETION_FAILURE, errorData.getErrorType());
statusFlow(flowId);
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
errorMessage = objectMapper.readValue(record.value(), ErrorMessage.class);
assertNotNull(errorMessage);
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 createAlreadyExistsFlowCommandBoltTest.
@Test
public void createAlreadyExistsFlowCommandBoltTest() throws Exception {
String flowId = UUID.randomUUID().toString();
ConsumerRecord<String, String> record;
createFlow(flowId);
record = cacheConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
record = nbConsumer.pollMessage();
assertNotNull(record);
assertNotNull(record.value());
createFlow(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.ALREADY_EXISTS, errorData.getErrorType());
}
Aggregations