Search in sources :

Example 1 with MirebalaisHospitalActivator

use of org.openmrs.module.mirebalais.MirebalaisHospitalActivator in project openmrs-module-mirebalais by PIH.

the class MirebalaisHospitalActivatorIT method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    initializeInMemoryDatabase();
    executeDataSet("requiredDataTestDataset.xml");
    executeDataSet("globalPropertiesTestDataset.xml");
    executeDataSet("serializedReportingDataset.xml");
    executeDataSet("fromMirebalaisMetadataModule.xml");
    authenticate();
    deployService.installBundle(conceptsFromMetadataSharing);
    personAttributeTypeBundle.install();
    // run the emrapi activator
    EmrApiActivator emrApiActivator = new EmrApiActivator();
    emrApiActivator.started();
    // set up metatdata from pih core first
    PihCoreActivator pihCoreActivator = new PihCoreActivator();
    Config config = mock(Config.class);
    when(config.getCountry()).thenReturn(ConfigDescriptor.Country.HAITI);
    when(config.getSite()).thenReturn(ConfigDescriptor.Site.MIREBALAIS);
    when(config.getBiometricsConfig()).thenReturn(new BiometricsConfigDescriptor());
    pihCoreActivator.setConfig(config);
    pihCoreActivator.started();
    MirebalaisHospitalActivator activator = new MirebalaisHospitalActivator();
    activator.setTestMode(true);
    activator.contextRefreshed();
    activator.started();
}
Also used : EmrApiActivator(org.openmrs.module.emrapi.EmrApiActivator) BiometricsConfigDescriptor(org.openmrs.module.pihcore.config.registration.BiometricsConfigDescriptor) PihCoreActivator(org.openmrs.module.pihcore.PihCoreActivator) Config(org.openmrs.module.pihcore.config.Config) MirebalaisHospitalActivator(org.openmrs.module.mirebalais.MirebalaisHospitalActivator) Before(org.junit.Before)

Example 2 with MirebalaisHospitalActivator

use of org.openmrs.module.mirebalais.MirebalaisHospitalActivator in project openmrs-module-mirebalais by PIH.

the class MirebalaisHospitalActivatorComponentTest method beforeEachTest.

@Before
public void beforeEachTest() throws Exception {
    initializeInMemoryDatabase();
    executeDataSet("requiredDataTestDataset.xml");
    executeDataSet("globalPropertiesTestDataset.xml");
    executeDataSet("mirebalaisProviderIdentifierGeneratorComponentTestDataset.xml");
    executeDataSet("fromMirebalaisMetadataModule.xml");
    executeDataSet("serializedReportingDataset.xml");
    authenticate();
    deployService.installBundle(conceptsFromMetadataSharing);
    haitiPersonAttributeTypeBundle.install();
    // run the emrapi activator
    emrApiActivator = new EmrApiActivator();
    emrApiActivator.started();
    // run the appointmentschedulingui manager
    appointmentSchedulingUIActivator = new AppointmentSchedulingUIActivator();
    appointmentSchedulingUIActivator.started();
    // set up metadata from pih core first
    pihCoreActivator = new PihCoreActivator();
    Config config = mock(Config.class);
    when(config.getCountry()).thenReturn(ConfigDescriptor.Country.HAITI);
    when(config.getSite()).thenReturn(ConfigDescriptor.Site.MIREBALAIS);
    when(config.getBiometricsConfig()).thenReturn(new BiometricsConfigDescriptor());
    pihCoreActivator.setConfig(config);
    pihCoreActivator.started();
    mirebalaisHospitalActivator = new MirebalaisHospitalActivator();
    // TODO: get ReportSetup to work while testing so we no longer need this
    mirebalaisHospitalActivator.setTestMode(true);
    mirebalaisHospitalActivator.willRefreshContext();
    mirebalaisHospitalActivator.contextRefreshed();
    mirebalaisHospitalActivator.willStart();
    mirebalaisHospitalActivator.started();
}
Also used : EmrApiActivator(org.openmrs.module.emrapi.EmrApiActivator) BiometricsConfigDescriptor(org.openmrs.module.pihcore.config.registration.BiometricsConfigDescriptor) PihCoreActivator(org.openmrs.module.pihcore.PihCoreActivator) Config(org.openmrs.module.pihcore.config.Config) AppointmentSchedulingUIActivator(org.openmrs.module.appointmentschedulingui.AppointmentSchedulingUIActivator) MirebalaisHospitalActivator(org.openmrs.module.mirebalais.MirebalaisHospitalActivator) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 EmrApiActivator (org.openmrs.module.emrapi.EmrApiActivator)2 MirebalaisHospitalActivator (org.openmrs.module.mirebalais.MirebalaisHospitalActivator)2 PihCoreActivator (org.openmrs.module.pihcore.PihCoreActivator)2 Config (org.openmrs.module.pihcore.config.Config)2 BiometricsConfigDescriptor (org.openmrs.module.pihcore.config.registration.BiometricsConfigDescriptor)2 AppointmentSchedulingUIActivator (org.openmrs.module.appointmentschedulingui.AppointmentSchedulingUIActivator)1