use of org.openkilda.messaging.command.yflow.SubFlowSharedEndpointEncapsulation in project open-kilda by telstra.
the class YFlowValidatorTest method failIfNegativeBandwidthProvided.
@Test(expected = InvalidFlowException.class)
public void failIfNegativeBandwidthProvided() throws InvalidFlowException, UnavailableFlowEndpointException {
YFlowRequest request = YFlowRequest.builder().yFlowId("test").maximumBandwidth(-1).sharedEndpoint(FlowEndpoint.builder().switchId(SWITCH_ID_1).portNumber(PORT_1).build()).subFlows(Arrays.asList(SubFlowDto.builder().flowId("test_1").sharedEndpoint(new SubFlowSharedEndpointEncapsulation(1, 0)).endpoint(FlowEndpoint.builder().switchId(SWITCH_ID_2).portNumber(PORT_2).build()).build(), SubFlowDto.builder().flowId("test_2").sharedEndpoint(new SubFlowSharedEndpointEncapsulation(2, 0)).endpoint(FlowEndpoint.builder().switchId(SWITCH_ID_3).portNumber(PORT_3).build()).build())).build();
yFlowValidator.validate(request);
}
use of org.openkilda.messaging.command.yflow.SubFlowSharedEndpointEncapsulation in project open-kilda by telstra.
the class YFlowValidatorTest method failIfNoSharedEndpointProvided.
@Test(expected = InvalidFlowException.class)
public void failIfNoSharedEndpointProvided() throws InvalidFlowException, UnavailableFlowEndpointException {
YFlowRequest request = YFlowRequest.builder().yFlowId("test").subFlows(Arrays.asList(SubFlowDto.builder().flowId("test_1").sharedEndpoint(new SubFlowSharedEndpointEncapsulation(1, 0)).endpoint(FlowEndpoint.builder().switchId(SWITCH_ID_2).portNumber(PORT_2).build()).build(), SubFlowDto.builder().flowId("test_2").sharedEndpoint(new SubFlowSharedEndpointEncapsulation(2, 0)).endpoint(FlowEndpoint.builder().switchId(SWITCH_ID_3).portNumber(PORT_3).build()).build())).build();
yFlowValidator.validate(request);
}
Aggregations