use of com.amazonaws.services.xray.model.GetSamplingRulesResult in project aws-xray-sdk-java by aws.
the class UnsignedXrayClientTest method getSamplingRules.
@Test
public void getSamplingRules() throws Exception {
stubFor(any(anyUrl()).willReturn(aResponse().withStatus(200).withBody(SAMPLING_RULES)));
GetSamplingRulesResult result = client.getSamplingRules(new GetSamplingRulesRequest());
GetSamplingRulesResult expected = OBJECT_MAPPER.readValue(SAMPLING_RULES, GetSamplingRulesResult.class);
assertThat(expected).isEqualTo(result);
verify(postRequestedFor(urlEqualTo("/GetSamplingRules")).withHeader("Content-Type", equalTo("application/json")).withRequestBody(equalToJson("{}")));
}
use of com.amazonaws.services.xray.model.GetSamplingRulesResult in project aws-xray-sdk-java by aws.
the class RulePoller method pollRule.
private void pollRule() {
Instant now = clock.instant();
logger.info("Polling sampling rules.");
GetSamplingRulesRequest req = new GetSamplingRulesRequest();
GetSamplingRulesResult records = client.getSamplingRules(req);
List<SamplingRule> rules = records.getSamplingRuleRecords().stream().map(SamplingRuleRecord::getSamplingRule).filter(CentralizedRule::isValid).collect(Collectors.toList());
manifest.putRules(rules, now);
}
Aggregations