use of org.openkilda.server42.control.messaging.Control.CommandPacket in project open-kilda by telstra.
the class GateTest method removeFlow.
@Test
public void removeFlow() throws Exception {
RemoveFlow removeFlow = RemoveFlow.builder().flowId("some-flow-id").build();
gate.listen(removeFlow);
CommandPacket commandPacket = getCommandPacket();
assertThat(commandPacket.getType()).isEqualTo(Type.REMOVE_FLOW);
assertThat(commandPacket.getCommandList()).hasSize(1);
Any command = commandPacket.getCommand(0);
assertThat(command.is(FlowRttControl.RemoveFlow.class)).isTrue();
FlowRttControl.RemoveFlow unpack = command.unpack(FlowRttControl.RemoveFlow.class);
assertThat(unpack.getFlow().getFlowId()).isEqualTo(removeFlow.getFlowId());
}
Aggregations