HttpBaggageRestrictionManagerProxy implements BaggageRestrictionManagerProxy { @Override public List<BaggageRestrictionResponse> getBaggageRestrictions(String serviceName) throws BaggageRestrictionManagerException { String jsonString; try { jsonString = makeGetRequest( "http: } catch (IOException e) { throw new BaggageRestrictionManagerException( "http call to get baggage restriction from local agent failed.", e); } return parseJson(jsonString); } HttpBaggageRestrictionManagerProxy(String hostPort); @Override List<BaggageRestrictionResponse> getBaggageRestrictions(String serviceName);  }
@Test public void testGetBaggageRestrictions() throws Exception { URI uri = target().getUri(); undertest = new HttpBaggageRestrictionManagerProxy(uri.getHost() + ":" + uri.getPort()); List<BaggageRestrictionResponse> response = undertest.getBaggageRestrictions("clairvoyant"); assertNotNull(response); assertEquals(1, response.size()); assertEquals(expectedRestriction, response.get(0)); }
@Test(expected = BaggageRestrictionManagerException.class) public void testGetSamplingStrategyError() throws Exception { URI uri = target().getUri(); undertest = new HttpBaggageRestrictionManagerProxy(uri.getHost() + ":" + uri.getPort()); undertest.getBaggageRestrictions(""); }