@Test(expected = ProjectNotFoundException.class) public void should_throw_exception_when_project_is_not_found() throws Exception { Throwable notFound = new BambooPlanNotFoundException("not found"); when(bamboo.findPlan(anyString())).thenThrow(notFound); SoftwareProjectId softwareProjectId = new SoftwareProjectId("projectId"); bambooConnection.isProjectDisabled(softwareProjectId); }
@Override public boolean isProjectDisabled(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException { checkConnected(); checkSoftwareProjectId(softwareProjectId); String planKey = softwareProjectId.getProjectId(); try { Plan plan = bamboo.findPlan(planKey); return !plan.isEnabled(); } catch (BambooPlanNotFoundException e) { throw new ProjectNotFoundException("Can't find plan with software project id: " + softwareProjectId, e); } }
BambooConnection implements BuildCapability, TestCapability { @Override public boolean isProjectDisabled(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException { checkConnected(); checkSoftwareProjectId(softwareProjectId); String planKey = softwareProjectId.getProjectId(); try { Plan plan = bamboo.findPlan(planKey); return !plan.isEnabled(); } catch (BambooPlanNotFoundException e) { throw new ProjectNotFoundException("Can't find plan with software project id: " + softwareProjectId, e); } } }
BambooConnection implements BuildCapability, TestCapability { @Override public boolean isProjectDisabled(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException { checkConnected(); checkSoftwareProjectId(softwareProjectId); String planKey = softwareProjectId.getProjectId(); try { Plan plan = bamboo.findPlan(planKey); return !plan.isEnabled(); } catch (BambooPlanNotFoundException e) { throw new ProjectNotFoundException("Can't find plan with software project id: " + softwareProjectId, e); } }  }
BambooConnection implements BuildCapability, TestCapability { @Override public boolean isProjectDisabled(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException { checkConnected(); checkSoftwareProjectId(softwareProjectId); String planKey = softwareProjectId.getProjectId(); try { Plan plan = bamboo.findPlan(planKey); return !plan.isEnabled(); } catch (BambooPlanNotFoundException e) { throw new ProjectNotFoundException("Can't find plan with software project id: " + softwareProjectId, e); } }  @Override void connect(String url, String login, String password); @Override boolean isBuilding(SoftwareProjectId softwareProjectId, String buildId); @Override BuildState getBuildState(SoftwareProjectId projectId, String buildId); @Override String getLastBuildId(SoftwareProjectId projectId); @Override void close(); @Override String getDescription(SoftwareProjectId softwareProjectId); @Override SoftwareProjectId identify(ProjectKey projectKey); @Override Date getEstimatedFinishTime(SoftwareProjectId projectId, String buildId); @Override Map<SoftwareProjectId, String> listSoftwareProjectIds(); @Override List<String> getBuildIds(SoftwareProjectId softwareProjectId); @Override String getMavenId(SoftwareProjectId softwareProjectId); @Override String getName(SoftwareProjectId softwareProjectId); @Override boolean isClosed(); @Override BuildTime getBuildTime(SoftwareProjectId softwareProjectId, String buildId); @Override boolean isProjectDisabled(SoftwareProjectId softwareProjectId); @Override List<Commiter> getBuildCommiters(SoftwareProjectId softwareProjectId, String buildId); @Override TestResult analyzeUnitTests(SoftwareProjectId projectId); @Override TestResult analyzeIntegrationTests(SoftwareProjectId projectId); }
BambooConnection implements BuildCapability, TestCapability { @Override public boolean isProjectDisabled(SoftwareProjectId softwareProjectId) throws ProjectNotFoundException { checkConnected(); checkSoftwareProjectId(softwareProjectId); String planKey = softwareProjectId.getProjectId(); try { Plan plan = bamboo.findPlan(planKey); return !plan.isEnabled(); } catch (BambooPlanNotFoundException e) { throw new ProjectNotFoundException("Can't find plan with software project id: " + softwareProjectId, e); } }  @Override void connect(String url, String login, String password); @Override boolean isBuilding(SoftwareProjectId softwareProjectId, String buildId); @Override BuildState getBuildState(SoftwareProjectId projectId, String buildId); @Override String getLastBuildId(SoftwareProjectId projectId); @Override void close(); @Override String getDescription(SoftwareProjectId softwareProjectId); @Override SoftwareProjectId identify(ProjectKey projectKey); @Override Date getEstimatedFinishTime(SoftwareProjectId projectId, String buildId); @Override Map<SoftwareProjectId, String> listSoftwareProjectIds(); @Override List<String> getBuildIds(SoftwareProjectId softwareProjectId); @Override String getMavenId(SoftwareProjectId softwareProjectId); @Override String getName(SoftwareProjectId softwareProjectId); @Override boolean isClosed(); @Override BuildTime getBuildTime(SoftwareProjectId softwareProjectId, String buildId); @Override boolean isProjectDisabled(SoftwareProjectId softwareProjectId); @Override List<Commiter> getBuildCommiters(SoftwareProjectId softwareProjectId, String buildId); @Override TestResult analyzeUnitTests(SoftwareProjectId projectId); @Override TestResult analyzeIntegrationTests(SoftwareProjectId projectId);  }