public void testTakesUpdates()
throws Exception
{
URI firstUri = URI.create("http://apple-a.example.com");
URI secondUri = URI.create("https://apple-a.example.com");
SparseTimeStat failureTimeStat = mock(SparseTimeStat.class);
when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.FAILURE))).thenReturn(failureTimeStat);
SparseTimeStat successTimeStat = mock(SparseTimeStat.class);
when(httpServiceBalancerStats.requestTime(any(URI.class), eq(Status.SUCCESS))).thenReturn(successTimeStat);
SparseCounterStat counterStat = mock(SparseCounterStat.class);
when(httpServiceBalancerStats.failure(any(URI.class), eq("testing failure"))).thenReturn(counterStat);
httpServiceBalancer.updateHttpUris(ImmutableSet.of(firstUri));