@Test public void testParseProbabilisticSampling() throws Exception { SamplingStrategyResponse response = undertest.parseJson(readFixture("probabilistic_sampling.json")); assertEquals(new ProbabilisticSamplingStrategy(0.01), response.getProbabilisticSampling()); assertNull(response.getRateLimitingSampling()); }
SamplingStrategyResponse parseJson(String json) { try { return gson.fromJson(json, SamplingStrategyResponse.class); } catch (JsonSyntaxException e) { throw new SamplingStrategyErrorException("Cannot deserialize json", e); } }
HttpSamplingManager implements SamplingManager { SamplingStrategyResponse parseJson(String json) { try { return gson.fromJson(json, SamplingStrategyResponse.class); } catch (JsonSyntaxException e) { throw new SamplingStrategyErrorException("Cannot deserialize json", e); } } }
HttpSamplingManager implements SamplingManager { SamplingStrategyResponse parseJson(String json) { try { return gson.fromJson(json, SamplingStrategyResponse.class); } catch (JsonSyntaxException e) { throw new SamplingStrategyErrorException("Cannot deserialize json", e); } } HttpSamplingManager();  HttpSamplingManager(String hostPort); }
HttpSamplingManager implements SamplingManager { SamplingStrategyResponse parseJson(String json) { try { return gson.fromJson(json, SamplingStrategyResponse.class); } catch (JsonSyntaxException e) { throw new SamplingStrategyErrorException("Cannot deserialize json", e); } } HttpSamplingManager();  HttpSamplingManager(String hostPort); @Override SamplingStrategyResponse getSamplingStrategy(String serviceName); }
HttpSamplingManager implements SamplingManager { SamplingStrategyResponse parseJson(String json) { try { return gson.fromJson(json, SamplingStrategyResponse.class); } catch (JsonSyntaxException e) { throw new SamplingStrategyErrorException("Cannot deserialize json", e); } } HttpSamplingManager();  HttpSamplingManager(String hostPort); @Override SamplingStrategyResponse getSamplingStrategy(String serviceName); static final String DEFAULT_HOST_PORT; }