@Test
public void testClose() {

    connectToSource(srcName, null);
    
    listener.close();
    
    ResponseBody body = TestListener.createReconnectMessage(srcName);
    listener.onMessage(body);
    assert rHandler.compareMessage(null);
    
    body = TestListener.createHttpMessage(new Response().status(200));
    listener.onMessage(body);
    assert hHandler.compareMessage(null);
    
    aHandler.lastMessage = null; // Resetting from auth in connectToSource
    body = TestListener.createAuthenticationResponse(true);
    listener.onMessage(body);
    assert aHandler.compareMessage(null);
    
    body = TestListener.createQueryMessage(new LinkedHashMap(), srcName);
    listener.onMessage(body);
    assert qHandler.compareMessage(null);
    
    body = TestListener.createPublishMessage(new LinkedHashMap(), srcName);
    listener.onMessage(body);
    assert pHandler.compareMessage(null);
    
    cHandler.lastMessage = null; // Resetting from message in connectToSource
    body = TestListener.createConfigResponse(new LinkedHashMap(), srcName);
    listener.onMessage(body);
    assert cHandler.compareMessage(null);
}