@Test
public void testIsConnected() throws Exception
{

    doReturn( resourceHostInfo ).when( hostRegistry ).getResourceHostByContainerHost( containerHostInfo );
    doReturn( true ).when( hostRegistry ).pingHost( anyString() );
    assertTrue( localPeer.isConnected( containerHost.getContainerId() ) );
    when( hostRegistry.getHostInfoById( CONTAINER_HOST_ID ) ).thenReturn( hostInfo );
    doReturn( "" ).when( hostInfo ).getId();
    assertFalse( localPeer.isConnected( containerHost.getContainerId() ) );
    HostDisconnectedException hostDisconnectedException = mock( HostDisconnectedException.class );
    doThrow( hostDisconnectedException ).when( hostRegistry ).getHostInfoById( CONTAINER_HOST_ID );
    assertFalse( localPeer.isConnected( containerHost.getContainerId() ) );
}