Skip to content

Commit 9c61cf8

Browse files
committed
ATT-38: AttachmentRestController2_0Test setup to use ObsService#registerHandler.
1 parent f9581c8 commit 9c61cf8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

omod-2.0/src/test/java/org/openmrs/module/attachments/rest/AttachmentRestController2_0Test.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import java.io.IOException;
77
import java.util.List;
8-
import java.util.Map;
98
import java.util.stream.Collectors;
109

1110
import org.apache.commons.beanutils.PropertyUtils;
@@ -14,7 +13,6 @@
1413
import org.junit.Test;
1514
import org.openmrs.Obs;
1615
import org.openmrs.Patient;
17-
import org.openmrs.api.ConceptService;
1816
import org.openmrs.api.ObsService;
1917
import org.openmrs.api.PatientService;
2018
import org.openmrs.module.attachments.AttachmentsConstants;
@@ -38,9 +36,6 @@ public class AttachmentRestController2_0Test extends MainResourceControllerTest
3836
@Autowired
3937
private ObsService obsService;
4038

41-
@Autowired
42-
private ConceptService conceptService;
43-
4439
@Autowired
4540
private PatientService patientService;
4641

@@ -55,10 +50,8 @@ public void setup() throws Exception {
5550
testHelper.init();
5651
obs = testHelper.getTestComplexObs();
5752

58-
Map<String, ComplexObsHandler> handlers = obsService.getHandlers();
59-
handlers.put(TestAttachmentBytesViewHandler.class.getSimpleName(),
53+
obsService.registerHandler(TestAttachmentBytesViewHandler.class.getSimpleName(),
6054
(ComplexObsHandler) new TestAttachmentBytesViewHandler());
61-
obsService.setHandlers(handlers);
6255
}
6356

6457
@After

0 commit comments

Comments
 (0)