@Test public void purgeVisitType_shouldDeleteGivenVisitType() { VisitType visitType = visitService.getVisitType(3); assertNotNull(visitType); visitService.purgeVisitType(visitType); visitType = visitService.getVisitType(3); assertNull(visitType); //Should reduce the existing number of visit types. assertEquals(2, visitService.getAllVisitTypes().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(VisitType visitType, RequestContext context) throws ResponseException { if (visitType == null) return; Context.getVisitService().purgeVisitType(visitType); }