@Test(expected = SonarProjectsNotFoundException.class)
public void should_throw_exception_when_projects_are_not_found() throws Exception {

    Throwable exception = new ResourceNotFoundException("");
    when(genericSoftwareClient.resource(anyString(), eq(Projects.class), eq(MediaType.APPLICATION_XML_TYPE)))
            .thenThrow(exception);
    sonarClient.findProjects();
}