@Test
public void should_return_all_projects_of_a_view() throws Exception {

    ListView viewResource = (ListView) load("hudson/view.xml", ListView.class);
    when(client.resource(anyString(), any(Class.class))).thenReturn(viewResource);
    List<String> projectNames = hudsonFinder.findJobNamesByView("android");
    assertEquals(4, projectNames.size());
    List<String> expectedProjects = Arrays.asList("android-1.11", "android-1.11-daily", "android-trunk",
            "android-trunk-daily");
    for (String expectedProject : expectedProjects) {
        assertTrue(projectNames.contains(expectedProject));
    }
}