From ace0adf48bea79d1333b77201d517f69ae46b4d3 Mon Sep 17 00:00:00 2001 From: mherman22 Date: Thu, 26 Sep 2024 00:37:31 +0300 Subject: [PATCH] use contenxt to access location service --- .../openmrs1_9/PersonAttributeController1_9Test.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/omod-1.9/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/controller/openmrs1_9/PersonAttributeController1_9Test.java b/omod-1.9/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/controller/openmrs1_9/PersonAttributeController1_9Test.java index eaa663ba2..6e71df580 100644 --- a/omod-1.9/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/controller/openmrs1_9/PersonAttributeController1_9Test.java +++ b/omod-1.9/src/test/java/org/openmrs/module/webservices/rest/web/v1_0/controller/openmrs1_9/PersonAttributeController1_9Test.java @@ -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; @@ -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 @@ -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)));