use of org.openkilda.messaging.command.flow.FlowPathSwapRequest in project open-kilda by telstra.
the class FlowPathSwapServiceTest method shouldSuccessfullySwapFlowPaths.
@Test
public void shouldSuccessfullySwapFlowPaths() {
// given
Flow origin = dummyFactory.makeFlowWithProtectedPath(flowSource, flowDestination, singletonList(islSourceDest), singletonList(islSourceDestAlt));
// when
FlowPathSwapService service = makeService();
FlowPathSwapRequest request = new FlowPathSwapRequest(origin.getFlowId(), true);
service.handleRequest(dummyRequestKey, commandContext, request);
verifyFlowStatus(origin.getFlowId(), FlowStatus.IN_PROGRESS);
SpeakerRequest speakerRequest;
while ((speakerRequest = requests.poll()) != null) {
produceAsyncResponse(service, dummyRequestKey, speakerRequest);
}
// then
Flow result = verifyFlowStatus(origin.getFlowId(), FlowStatus.UP);
verifyPathSwapped(origin, result);
verifyNorthboundSuccessResponse(carrier);
}
use of org.openkilda.messaging.command.flow.FlowPathSwapRequest in project open-kilda by telstra.
the class FlowPathSwapServiceTest method shouldSuccessfullySwapYFlowPaths.
@Test
public void shouldSuccessfullySwapYFlowPaths() {
// given
Flow origin = dummyFactory.makeFlowWithProtectedPath(flowSource, flowDestination, singletonList(islSourceDest), singletonList(islSourceDestAlt));
createTestYFlowForSubFlow(origin);
// when
FlowPathSwapService service = makeService();
FlowPathSwapRequest request = new FlowPathSwapRequest(origin.getFlowId(), false);
service.handleRequest(dummyRequestKey, commandContext, request);
verifyFlowStatus(origin.getFlowId(), FlowStatus.IN_PROGRESS);
SpeakerRequest speakerRequest;
while ((speakerRequest = requests.poll()) != null) {
produceAsyncResponse(service, dummyRequestKey, speakerRequest);
}
// then
Flow result = verifyFlowStatus(origin.getFlowId(), FlowStatus.UP);
verifyPathSwapped(origin, result);
verifyNorthboundSuccessResponse(carrier);
}
Aggregations