@Test(expected = ProjectNotFoundException.class)
public void should_throw_exception_when_identifying_inexistant_project() throws Exception {

    Throwable notFound = new SonarResourceNotFoundException("not found");
    when(sonarClient.findResource(anyString())).thenThrow(notFound);
    ProjectKey projectKey = new ProjectKey();
    sonar.identify(projectKey);
}