assertNull(_state.getClient("service-1", uri));
Map<String,Object> transportProperties = new HashMap<String,Object>();
transportProperties.put("foobar", "unsupportedValue");
_serviceRegistry.put("service-1", new ServiceProperties("service-1", "cluster-1",
"/test", "random", null,
Collections.<String, Object>emptyMap(),
transportProperties, null, schemes, null));
// we add the property first before listening to the service because the MockStore will
// immediately publish to the eventBus when listenToService() is called, whereas the
// ZooKeeper stores wait until we get a response back from zookeeper, which triggers handlePut.
CountDownLatch cdl1 = new CountDownLatch(1);
_state.listenToService("service-1", new SimpleLoadBalancer.SimpleLoadBalancerCountDownCallback(cdl1));
// Verify the callback did NOT get invoked, i.e., the exception was thrown during handlePut()
assertEquals(cdl1.getCount(), 1);
// set up state
CountDownLatch cdl2 = new CountDownLatch(1);
_state.listenToCluster("cluster-1", new SimpleLoadBalancer.SimpleLoadBalancerCountDownCallback(cdl2));
assertTrue(cdl2.await(60, TimeUnit.SECONDS));
_uriRegistry.put("cluster-1", new UriProperties("cluster-1", uriData));
assertNull(_state.getClient("service-1", uri));
_serviceRegistry.put("service-1", new ServiceProperties("service-1", "cluster-1",
"/test", "random", null,
Collections.<String, Object>emptyMap(),
null, null, schemes, null));
CountDownLatch cdl = new CountDownLatch(1);