@Test
public void testMessageBeforeLogonWithBoundSession() throws Exception {

    IoSession mockIoSession = mock(IoSession.class);
    try (Session qfSession = SessionFactoryTestSupport.createSession()) {
        stub(mockIoSession.getAttribute("QF_SESSION")).toReturn(qfSession);
        EventHandlingStrategy mockEventHandlingStrategy = mock(EventHandlingStrategy.class);
        Logout logout = new Logout();
        logout.getHeader()
                .setString(SenderCompID.FIELD, qfSession.getSessionID().getSenderCompID());
        logout.getHeader()
                .setString(TargetCompID.FIELD, qfSession.getSessionID().getTargetCompID());
        HashMap<SessionID, Session> acceptorSessions = new HashMap<>();
        AcceptorIoHandler handler = new AcceptorIoHandler(createSessionProvider(acceptorSessions),
                new NetworkingOptions(new Properties()), mockEventHandlingStrategy);
        handler.processMessage(mockIoSession, logout);
        verify(mockIoSession).getAttribute("QF_SESSION");
        verify(mockEventHandlingStrategy).onMessage(qfSession, logout);
    }
}