SimpleCallStateMachine { public boolean isHandshakeCompleted() { return this.handshakeIsComplete; } SimpleCallStateMachine(final String callId); long getTimeOfFirstMessage(); long getTimeOfLastMessage(); boolean isHandshakeCompleted(); boolean reTransmitsDetected(); void onEvent(final SipPacket msg); boolean isTerminated(); List<SipPacket> getMessages(); List<CallState> getTransitions(); CallState getCallState(); long getPostDialDelay(); long getDuration();  }
@Test public void testMissingTraffic() throws Exception { final List<SipPacket> messages = loadMessages("simple_invite_scenario.pcap"); messages.set(0, null); messages.set(1, null); SimpleCallStateMachine fsm = driveTraffic(messages); assertStates(fsm, RINGING, IN_CALL, COMPLETED); assertThat(fsm.isHandshakeCompleted(), is(true)); messages.set(2, null); messages.set(3, null); fsm = driveTraffic(messages); assertStates(fsm, IN_CALL, COMPLETED); assertThat(fsm.isHandshakeCompleted(), is(false)); messages.set(4, null); fsm = driveTraffic(messages); assertStates(fsm, COMPLETED); assertThat(fsm.isHandshakeCompleted(), is(false)); messages.set(5, null); fsm = driveTraffic(messages); assertStates(fsm, COMPLETED); }