/** * @see org.openmrs.api.LocationService#getLocationTags(java.lang.String) */ @Override @Transactional(readOnly = true) public List<LocationTag> getLocationTags(String search) throws APIException { if (StringUtils.isEmpty(search)) { return Context.getLocationService().getAllLocationTags(true); } return dao.getLocationTags(search); }
/** * @see LocationService#getAllLocationTags() */ @Test public void getAllLocationTags_shouldReturnAllLocationTagsIncludingRetired() { List<LocationTag> tags = Context.getLocationService().getAllLocationTags(); Assert.assertEquals(6, tags.size()); }
/** * @see LocationService#getAllLocationTags(null) */ @Test public void getAllLocationTags_shouldReturnAllLocationTagsIfIncludeRetiredIsTrue() { List<LocationTag> tags = Context.getLocationService().getAllLocationTags(true); Assert.assertEquals(6, tags.size()); }
/** * @see LocationService#getAllLocationTags(null) */ @Test public void getAllLocationTags_shouldReturnOnlyUnretiredLocationTagsIfIncludeRetiredIsFalse() { List<LocationTag> tags = Context.getLocationService().getAllLocationTags(false); Assert.assertEquals(5, tags.size()); }
List<LocationTag> tagsBeforeRetired = ls.getAllLocationTags(true); List<LocationTag> tagsNotRetiredBefore = ls.getAllLocationTags(false); List<LocationTag> tagsAfterRetired = ls.getAllLocationTags(true); List<LocationTag> tagsNotRetiredAfter = ls.getAllLocationTags(false);
/** * @see org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceControllerTest#getAllCount() */ @Override public long getAllCount() { return service.getAllLocationTags(false).size(); }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#doGetAll(org.openmrs.module.webservices.rest.web.RequestContext) */ @Override protected NeedsPaging<LocationTag> doGetAll(RequestContext context) throws ResponseException { return new NeedsPaging<LocationTag>(service().getAllLocationTags(context.getIncludeAll()), context); }