Search in sources :

Example 1 with ExistingOrNewVisitAssignmentHandler

use of org.openmrs.api.handler.ExistingOrNewVisitAssignmentHandler in project openmrs-core by openmrs.

the class EncounterServiceTest method getVisitAssignmentHandlers_shouldReturnTheExistingOrNewVisitAssignmentHandler.

/**
 * @see EncounterService#getVisitAssignmentHandlers()
 */
@Test
public void getVisitAssignmentHandlers_shouldReturnTheExistingOrNewVisitAssignmentHandler() {
    List<EncounterVisitHandler> handlers = Context.getEncounterService().getEncounterVisitHandlers();
    boolean found = false;
    for (EncounterVisitHandler handler : handlers) {
        if (handler instanceof ExistingOrNewVisitAssignmentHandler) {
            found = true;
            break;
        }
    }
    Assert.assertTrue("The 'existing or new visit only assignment' handler was not found", found);
}
Also used : ExistingOrNewVisitAssignmentHandler(org.openmrs.api.handler.ExistingOrNewVisitAssignmentHandler) EncounterVisitHandler(org.openmrs.api.handler.EncounterVisitHandler) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) Test(org.junit.Test)

Example 2 with ExistingOrNewVisitAssignmentHandler

use of org.openmrs.api.handler.ExistingOrNewVisitAssignmentHandler in project openmrs-core by openmrs.

the class ContextTest method getRegisteredComponent_shouldReturnBeanHaveBeenRegisteredOfThePassedTypeAndName.

/**
 * @see Context#getRegisteredComponent(String,Class)
 */
@Test
public void getRegisteredComponent_shouldReturnBeanHaveBeenRegisteredOfThePassedTypeAndName() {
    EncounterVisitHandler registeredComponent = Context.getRegisteredComponent("existingOrNewVisitAssignmentHandler", EncounterVisitHandler.class);
    Assert.assertTrue(registeredComponent instanceof ExistingOrNewVisitAssignmentHandler);
}
Also used : ExistingOrNewVisitAssignmentHandler(org.openmrs.api.handler.ExistingOrNewVisitAssignmentHandler) EncounterVisitHandler(org.openmrs.api.handler.EncounterVisitHandler) Test(org.junit.Test) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest)

Aggregations

Test (org.junit.Test)2 EncounterVisitHandler (org.openmrs.api.handler.EncounterVisitHandler)2 ExistingOrNewVisitAssignmentHandler (org.openmrs.api.handler.ExistingOrNewVisitAssignmentHandler)2 BaseContextSensitiveTest (org.openmrs.test.BaseContextSensitiveTest)2