/** * @see CohortService#purgeCohort(Cohort) */ @Test public void purgeCohort_shouldDeleteCohortFromDatabase() { executeDataSet(COHORT_XML); List<Cohort> allCohorts = service.getAllCohorts(true); assertEquals(2, allCohorts.size()); service.purgeCohort(allCohorts.get(0)); allCohorts = service.getAllCohorts(true); assertEquals(1, allCohorts.size()); }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#purge(java.lang.Object, * org.openmrs.module.webservices.rest.web.RequestContext) */ @Override public void purge(Cohort cohort, RequestContext context) throws ResponseException { if (cohort == null) { // http operation DELETE is idempotent, so we return success here return; } Context.getCohortService().purgeCohort(cohort); }