Hudson { public List<String> findJobNames() { List<String> jobNames = hudsonFinder.findJobNames(); return jobNames; } Hudson(String hudsonUrl);  Hudson(String hudsonUrl, String login, String password); List<HudsonJob> findAllProjects(); List<String> findAllProjectNames(); HudsonBuild findBuild(String jobName, int buildNumber); HudsonJob findJob(String jobName); String getDescription(String jobName); Date getEstimatedFinishTime(String jobName); int getLastBuildNumber(String projectName); List<String> findJobNames(); List<String> findViews(); List<String> findJobNameByView(String viewName); String findMavenId(String jobName); List<Integer> getBuildNumbers(String jobName); HudsonTestResult findUnitTestResult(String jobName, int lastBuildNumber); HudsonTestResult findIntegrationTestResult(String jobName, int lastBuildNumber); String getUrl();  }
@Test public void should_get_project_names() { List<String> projectNames = new ArrayList<String>(); projectNames.add("project1"); projectNames.add("project2"); when(hudsonFinder.findJobNames()).thenReturn(projectNames); List<String> names = hudson.findJobNames(); assertEquals("project1", names.get(0)); assertEquals("project2", names.get(1)); }