@Test
public void testLogonIsFirstMessageOnAcceptor() throws Exception {

    // set up some basic stuff
    final SessionID sessionID = new SessionID(
            FixVersions.BEGINSTRING_FIX44, "SENDER", "TARGET");
    final SessionSettings settings = SessionSettingsTest.setUpSession(null);
    setupFileStoreForQFJ357(sessionID, settings);
    // Session gets constructed, triggering a reset
    final UnitTestApplication application = new UnitTestApplication();
    try (Session session = setUpFileStoreSession(application, false,
            new UnitTestResponder(), settings, sessionID)) {
        final SessionState state = getSessionState(session);
        
        assertEquals(1, state.getNextSenderMsgSeqNum());
        assertEquals(1, state.getNextTargetMsgSeqNum());
        
        logonTo(session);
        
        // we should only answer with a Logon message
        assertEquals(1, application.toAdminMessages.size());
        assertEquals(MsgType.LOGON, application.toAdminMessages.get(0)
                .getHeader().getString(MsgType.FIELD));
        
        // no reset should have been triggered by QF/J after the Logon attempt
        assertEquals(0, application.sessionResets);
        assertTrue("Session should be connected", session.isLoggedOn());
        
        assertEquals(2, state.getNextSenderMsgSeqNum());
        assertEquals(2, state.getNextTargetMsgSeqNum());
    }
}