DemoConnection implements BuildCapability, TestCapability, ViewCapability, MetricCapability { @Override public String getLastBuildId(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException, BuildIdNotFoundException { String lastBuildId = "1"; if (softwareProjectId.equals(mars)) { return marsProj.getLastBuildId(); } return lastBuildId; } DemoConnection(); @Override void connect(String url, String login, String password); @Override void close(); @Override boolean isClosed(); @Override Map<SoftwareProjectId, String> listSoftwareProjectIds(); @Override String getMavenId(SoftwareProjectId softwareProjectId); @Override String getDescription(SoftwareProjectId softwareProjectId); @Override String getName(SoftwareProjectId projectId); @Override SoftwareProjectId identify(ProjectKey projectKey); @Override boolean isProjectDisabled(SoftwareProjectId softwareProjectId); @Override Map<String, List<QualityMetric>> getMetricsByCategory(); @Override QualityResult analyzeQuality(SoftwareProjectId projectId, String... metrics); @Override List<SoftwareProjectId> findSoftwareProjectIdsByViews(List<String> views); @Override List<String> findViews(); @Override List<String> findProjectNamesByView(String viewName); @Override TestResult analyzeUnitTests(SoftwareProjectId projectId); @Override TestResult analyzeIntegrationTests(SoftwareProjectId projectId); @Override List<Commiter> getBuildCommiters(SoftwareProjectId softwareProjectId, String buildId); @Override BuildTime getBuildTime(SoftwareProjectId softwareProjectId, String buildId); @Override List<String> getBuildIds(SoftwareProjectId softwareProjectId); @Override BuildState getBuildState(SoftwareProjectId projectId, String buildId); @Override Date getEstimatedFinishTime(SoftwareProjectId projectId, String buildId); @Override boolean isBuilding(SoftwareProjectId projectId, String buildId); @Override String getLastBuildId(SoftwareProjectId softwareProjectId); @Override String toString();  }
@Test public void last_build_id_is_always_0() throws ProjectNotFoundException, BuildIdNotFoundException { String lastBuildId = connection.getLastBuildId(earth); assertEquals("1", lastBuildId); }