use of io.syndesis.qe.resource.impl.Jaeger in project syndesis-qe by syndesisio.
the class OperatorValidationSteps method checkJaeger.
@Then("^check that jaeger pod \"([^\"]*)\" (is|is not) collecting metrics for integration \"([^\"]*)\"$")
public void checkJaeger(String jaegerPodName, String shouldCollect, String integrationName) {
TestUtils.sleepIgnoreInterrupt(30000L);
LocalPortForward lpf = OpenShiftUtils.createLocalPortForward(OpenShiftUtils.getPod(p -> p.getMetadata().getName().startsWith(jaegerPodName)), 16686, 16686);
final String integrationId = integrations.getIntegrationId(integrationName).get();
// host for default syndesis-jaeger
String host = "localhost:16686";
if (ResourceFactory.get(Syndesis.class).containsAddonProperty(Addon.JAEGER, "collectorUri")) {
host = ResourceFactory.get(Jaeger.class).getQueryServiceHost();
}
JSONArray jsonData = new JSONObject(HTTPUtils.doGetRequest("http://" + host + "/api/traces?service=" + integrationId).getBody()).getJSONArray("data");
OpenShiftUtils.terminateLocalPortForward(lpf);
if ("is".equals(shouldCollect)) {
assertThat(jsonData).size().isNotZero();
} else {
assertThat(jsonData).size().isZero();
}
}
Aggregations