@Test
public void testOnRequest() throws Exception
{

    listener.onRequest( payload );
    verify( localPeer ).executeAsync( any( RequestBuilder.class ), eq( host ), any( CommandCallback.class ) );
    doThrow( exception ).when( localPeer )
                        .executeAsync( any( RequestBuilder.class ), eq( host ), any( CommandCallback.class ) );
    listener.onRequest( payload );
    verify( exception ).printStackTrace( any( PrintStream.class ) );
    when( payload.getMessage( CommandRequest.class ) ).thenReturn( null );
    listener.onRequest( payload );
    verify( peerManager, times( 2 ) ).getPeer( any( String.class ) );
}