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

    Throwable notFound = new SonarResourceNotFoundException("not found");
    when(sonarClient.findResource(anyString())).thenThrow(notFound);
    SoftwareProjectId softwareProjectId = new SoftwareProjectId("projectId");
    sonar.getName(softwareProjectId);
}