Search in sources :

Example 11 with SubFlowSharedEndpointEncapsulation

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);
}
Also used : SubFlowSharedEndpointEncapsulation(org.openkilda.messaging.command.yflow.SubFlowSharedEndpointEncapsulation) YFlowRequest(org.openkilda.messaging.command.yflow.YFlowRequest) Test(org.junit.Test)

Example 12 with SubFlowSharedEndpointEncapsulation

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);
}
Also used : SubFlowSharedEndpointEncapsulation(org.openkilda.messaging.command.yflow.SubFlowSharedEndpointEncapsulation) YFlowRequest(org.openkilda.messaging.command.yflow.YFlowRequest) Test(org.junit.Test)

Aggregations

SubFlowSharedEndpointEncapsulation (org.openkilda.messaging.command.yflow.SubFlowSharedEndpointEncapsulation)12 YFlowRequest (org.openkilda.messaging.command.yflow.YFlowRequest)8 Test (org.junit.Test)7 FlowEndpoint (org.openkilda.model.FlowEndpoint)5 YFlow (org.openkilda.model.YFlow)5 SubFlowDto (org.openkilda.messaging.command.yflow.SubFlowDto)4 Flow (org.openkilda.model.Flow)4 YSubFlow (org.openkilda.model.YSubFlow)4 FlowProcessingException (org.openkilda.wfm.topology.flowhs.exception.FlowProcessingException)4 ArrayList (java.util.ArrayList)1 SubFlowPartialUpdateDto (org.openkilda.messaging.command.yflow.SubFlowPartialUpdateDto)1 SwitchId (org.openkilda.model.SwitchId)1 CommandContext (org.openkilda.wfm.CommandContext)1