@Test
public void testCreateBalancer()
{

    ReportExporter reportExporter = mock(ReportExporter.class);
    ReportCollectionFactory reportCollectionFactory = new ReportCollectionFactory(reportExporter);
    StaticHttpServiceBalancerFactory factory = new StaticHttpServiceBalancerFactory(reportExporter, reportCollectionFactory);
    HttpServiceBalancer balancer = factory.createHttpServiceBalancer(
            "foo",
            new StaticHttpServiceConfig().setUris(UriMultiset.valueOf("http://invalid.invalid")),
            new HttpServiceBalancerConfig());
    HttpServiceAttempt attempt = balancer.createAttempt();
    assertEquals(attempt.getUri(), URI.create("http://invalid.invalid"));
    attempt.markGood();
    verify(reportExporter).export(balancer, false, "ServiceClient", ImmutableMap.of("serviceType", "foo"));
    ArgumentCaptor<SparseTimeStat> statsCaptor = ArgumentCaptor.forClass(SparseTimeStat.class);
    verify(reportExporter).export(statsCaptor.capture(), eq(false), eq("ServiceClient.RequestTime"),
            eq(ImmutableMap.of("serviceType", "foo", "targetUri", "http://invalid.invalid", "status", "success")));
    verifyNoMoreInteractions(reportExporter);
}