Search in sources :

Example 1 with ComponentRequest

use of org.sonarqube.ws.client.measures.ComponentRequest in project sonar-web by SonarSource.

the class HtmlTestSuite method getMeasure.

static Measures.Measure getMeasure(Orchestrator orchestrator, String componentKey, String metricKey) {
    Measures.ComponentWsResponse response = newWsClient(orchestrator).measures().component(new ComponentRequest().setComponent(componentKey).setMetricKeys(singletonList(metricKey)));
    List<Measures.Measure> measures = response.getComponent().getMeasuresList();
    return measures.size() == 1 ? measures.get(0) : null;
}
Also used : Measures(org.sonarqube.ws.Measures) ComponentRequest(org.sonarqube.ws.client.measures.ComponentRequest)

Aggregations

Measures (org.sonarqube.ws.Measures)1 ComponentRequest (org.sonarqube.ws.client.measures.ComponentRequest)1