Search in sources :

Example 1 with PaperRecordDAO

use of org.openmrs.module.paperrecord.db.PaperRecordDAO in project openmrs-module-mirebalais by PIH.

the class PaperRecordServiceIT method setUp.

@Before
public void setUp() {
    paperRecordService = new PaperRecordServiceImpl();
    patientService = mock(PatientService.class);
    administrationService = mock(AdministrationService.class);
    paperRecordProperties = mock(PaperRecordProperties.class);
    paperRecordDAO = mock(PaperRecordDAO.class);
    ((PaperRecordServiceImpl) paperRecordService).setIdentifierSourceService(identifierSourceService);
    ((PaperRecordServiceImpl) paperRecordService).setPatientService(patientService);
    ((PaperRecordServiceImpl) paperRecordService).setPaperRecordProperties(paperRecordProperties);
    ((PaperRecordServiceImpl) paperRecordService).setPaperRecordDAO(paperRecordDAO);
    // so we handle the hack in PaperRecordServiceImpl where internal methods are fetched via Context.getService
    mockStatic(Context.class);
    when(Context.getService(PaperRecordService.class)).thenReturn(paperRecordService);
}
Also used : PaperRecordDAO(org.openmrs.module.paperrecord.db.PaperRecordDAO) AdministrationService(org.openmrs.api.AdministrationService) PatientService(org.openmrs.api.PatientService) PaperRecordProperties(org.openmrs.module.paperrecord.PaperRecordProperties) PaperRecordServiceImpl(org.openmrs.module.paperrecord.PaperRecordServiceImpl) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 AdministrationService (org.openmrs.api.AdministrationService)1 PatientService (org.openmrs.api.PatientService)1 PaperRecordProperties (org.openmrs.module.paperrecord.PaperRecordProperties)1 PaperRecordServiceImpl (org.openmrs.module.paperrecord.PaperRecordServiceImpl)1 PaperRecordDAO (org.openmrs.module.paperrecord.db.PaperRecordDAO)1