private void setUpCallLog(CallDirection callDirection) {
    String patientDocId = "patientDocId";
    String clinicId = "clinicId";
    callLog = new CallLog(patientDocId);
    callLog.patientId("patientId");
    initiatedTime = DateUtil.newDateTime(2011, 10, 10, 10, 9, 10);
    startTime = DateUtil.newDateTime(2011, 10, 10, 10, 10, 10);
    callLog.setStartTime(initiatedTime);
    callLog.setEndTime(DateUtil.now());
    callLog.setCallDirection(callDirection);
    callLog.clinicId(clinicId);
    callLog.setPhoneNumber("1234567890");
    callLog.callLanguage("en");

    final CallEvent callEvent = mock(CallEvent.class);
    when(callEvent.getTimeStamp()).thenReturn(startTime);
    CallEventCustomData customData = new CallEventCustomData();
    customData.add(TAMAIVRContext.MESSAGE_CATEGORY_NAME, "All Messages");
    when(callEvent.getData()).thenReturn(customData);
    callLog.setCallEvents(
        new ArrayList<CallEvent>() {
          {
            add(callEvent);
          }
        });
    Clinic clinic = new Clinic(clinicId);
    Patient patient =
        PatientBuilder.startRecording()
            .withId(patientDocId)
            .withPatientId("patientId")
            .withGender(Gender.newGender("Male"))
            .withClinic(clinic)
            .withTravelTimeToClinicInDays(1)
            .withTravelTimeToClinicInHours(1)
            .withTravelTimeToClinicInMinutes(1)
            .withDateOfBirth(DateUtil.today().minusYears(40))
            .build();
    CallLogView callLogView = mock(CallLogView.class);
    clinic.setName("clinicName");

    when(allIVRLanguages.getByCode("en")).thenReturn(IVRLanguage.newIVRLanguage("English", "en"));
    when(allPatients.getAll()).thenReturn(asList(patient));
    when(callLogViewMapper.toCallLogView(asList(callLog))).thenReturn(asList(callLogView));

    callLogSummaryBuilder =
        new CallLogSummaryBuilder(allPatients, new Patients(allPatients.getAll()), allIVRLanguages);
  }
Exemplo n.º 2
0
 @Override
 public void load() {
   allGenders.add(Gender.newGender("Male"));
   allGenders.add(Gender.newGender("Female"));
 }