use of org.openmrs.module.appframework.service.AppFrameworkServiceImpl in project openmrs-module-mirebalais by PIH.
the class RequireUtilTest method setup.
@Before
public void setup() throws Exception {
appFrameworkService = new AppFrameworkServiceImpl(null, null, null, null, null, null, null, null);
doctor = new Role("Doctor");
admin = new Role("Admin");
Privilege enterConsultNote = new Privilege(Privileges.TASK_EMR_ENTER_CONSULT_NOTE.privilege());
enterConsultNote.setUuid(Privileges.TASK_EMR_ENTER_CONSULT_NOTE.uuid());
enterConsultNote.setDescription(Privileges.TASK_EMR_ENTER_CONSULT_NOTE.description());
Privilege retroClinicalNote = new Privilege(Privileges.TASK_EMR_RETRO_CLINICAL_NOTE.privilege());
retroClinicalNote.setUuid(Privileges.TASK_EMR_RETRO_CLINICAL_NOTE.uuid());
retroClinicalNote.setDescription(Privileges.TASK_EMR_RETRO_CLINICAL_NOTE.description());
Privilege retroClinicalNoteThisProviderOnly = new Privilege(Privileges.TASK_EMR_RETRO_CLINICAL_NOTE_THIS_PROVIDER_ONLY.privilege());
retroClinicalNoteThisProviderOnly.setUuid(Privileges.TASK_EMR_RETRO_CLINICAL_NOTE_THIS_PROVIDER_ONLY.uuid());
retroClinicalNoteThisProviderOnly.setDescription(Privileges.TASK_EMR_RETRO_CLINICAL_NOTE_THIS_PROVIDER_ONLY.description());
doctor.addPrivilege(enterConsultNote);
doctor.addPrivilege(retroClinicalNoteThisProviderOnly);
admin.addPrivilege(enterConsultNote);
admin.addPrivilege(retroClinicalNote);
user = new User();
user.setUsername("bobMeIn");
user.setUuid("123-456");
user.setSystemId("abc");
user.setRetired(true);
userContext = mock(UserContext.class);
when(userContext.getAuthenticatedUser()).thenReturn(user);
uiSessionContext = new UiSessionContext();
uiSessionContext.setUserContext(userContext);
}
Aggregations