DemoConnection implements BuildCapability, TestCapability, ViewCapability, MetricCapability { @Override public List<SoftwareProjectId> findSoftwareProjectIdsByViews(List<String> views) { List<SoftwareProjectId> softwareProjectIds = new ArrayList<SoftwareProjectId>(); if (views.contains("Telluriques")) { softwareProjectIds.add(earth); } return softwareProjectIds; } 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 should_get_earth_project_id_on_view_1() { List<String> views = new ArrayList<String>(); views.add("Telluriques"); List<SoftwareProjectId> softwareProjectIds = connection.findSoftwareProjectIdsByViews(views); assertTrue(softwareProjectIds.contains(earth)); }