@Test(expected = SonarMeasureNotFoundException.class)
public void should_throw_exception_when_sonar_connection_fails() throws SonarMeasureNotFoundException {

    when(sonar.find(Mockito.any(ResourceQuery.class))).thenThrow(new ConnectionException());
    sonarClient.findMeasure("artifactId", "measureKey");
}