@Test
public void should_build_valid_unit_test_result() throws SonarMeasureNotFoundException {

    Measure[] measures = new Measure[5];
    for (Integer i = 0; i < measures.length; i++) {
        measures[i] = new Measure();
        measures[i].setValue(i.doubleValue());
    }
    when(sonarClient.findMeasure("artifactId", "coverage")).thenReturn(measures[0]);
    when(sonarClient.findMeasure("artifactId", "test_failures")).thenReturn(measures[1]);
    when(sonarClient.findMeasure("artifactId", "test_errors")).thenReturn(measures[2]);
    when(sonarClient.findMeasure("artifactId", "tests")).thenReturn(measures[3]);
    when(sonarClient.findMeasure("artifactId", "skipped_tests")).thenReturn(measures[4]);
    SoftwareProjectId projectId = new SoftwareProjectId("artifactId");
    TestResult unitTestResult = sonar.analyzeUnitTests(projectId);
    assertEquals(0, unitTestResult.getCoverage(), 0);
    assertEquals(3, unitTestResult.getFailCount(), 0);
    assertEquals(4, unitTestResult.getSkipCount(), 0);
    assertEquals(0, unitTestResult.getPassCount(), 0);
}