@Test
public void testGapFillSatisfiesResendRequest() throws Exception {

    final UnitTestApplication application = new UnitTestApplication();
    try (Session session = setUpSession(application, false,
            new UnitTestResponder())) {
        final SessionState state = getSessionState(session);
        
        session.setNextTargetMsgSeqNum(684);
        logonTo(session, 687);
        
        assertTrue(state.isResendRequested());
        assertEquals(684, state.getNextTargetMsgSeqNum());
        processMessage(session, createResendRequest(688, 1));
        
        processMessage(session, createSequenceReset(684, 688, true));
        
        processMessage(session, createHeartbeatMessage(689));
        
        assertFalse(state.isResendRequested());
    }
}