Skip to content

Commit

Permalink
use contenxt to access location service
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Sep 25, 2024
1 parent fac48d5 commit ace0adf
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.junit.Test;
import org.openmrs.Location;
import org.openmrs.PersonAttribute;
import org.openmrs.api.LocationService;
import org.openmrs.api.PersonService;
import org.openmrs.api.context.Context;
import org.openmrs.module.webservices.rest.SimpleObject;
Expand All @@ -42,12 +41,9 @@ public class PersonAttributeController1_9Test extends MainResourceControllerTest

private PersonService service;

private LocationService locationService;

@Before
public void before() throws Exception {
this.service = Context.getPersonService();
this.locationService = Context.getLocationService();
}

@Test
Expand Down Expand Up @@ -155,7 +151,7 @@ public void shouldSupportLocationPersonAttributeBySettingUuidAsValue() throws Ex
String personAttributeTypeUuid = (String) personAttributeType.get("uuid");
assertThat(personAttributeTypeUuid, is(notNullValue()));

Location location = locationService.getLocation(1);
Location location = Context.getLocationService().getLocation(1);

String personAttributeJson = "{ \"attributeType\":\"" + personAttributeTypeUuid + "\", \"value\":\"" + location.getUuid() + "\"}";
SimpleObject personAttribute = deserialize(handle(newPostRequest(getURI(), personAttributeJson)));
Expand Down

0 comments on commit ace0adf

Please sign in to comment.