@Test
public void testUpdateHost() throws Exception
{

    WebClient webClient = mock( WebClient.class );
    doReturn( webClient ).when( registry ).getWebClient( anyString(), anyString() );
    Response response = mock( Response.class );
    doReturn( response ).when( webClient ).get();
    doReturn( Response.Status.OK.getStatusCode() ).when( response ).getStatus();
    registry.updateHost( resourceHostInfo );
    verify( registry ).updateResourceHostEntryTimestamp( HOST_ID );
    ResourceHost resourceHost = mock( ResourceHost.class );
    doReturn( HOST_ID ).when( resourceHost ).getId();
    registry.updateHost( resourceHost );
    verify( registry ).getResourceHostInfoById( HOST_ID );
    doThrow( new HostDisconnectedException( null ) ).when( registry ).getResourceHostInfoById( HOST_ID );
    registry.updateHost( resourceHost );
    verify( registry ).requestHeartbeat( resourceHost );
}