コード例 #1
0
  @Test
  public void shouldBuildCallSummaryForGivenInboundCallLog() {
    setUpCallLog(CallDirection.Inbound);
    CallLogSummary callLogSummary = callLogSummaryBuilder.build(callLog);

    assertNotNull(callLogSummary);
    assertEquals("clinicName", callLogSummary.getClinicName());
    assertEquals("Patient", callLogSummary.getSourcePhoneNumber());
    assertEquals("TAMA", callLogSummary.getDestinationPhoneNumber());
    assertEquals("NA", callLogSummary.getInitiatedDateTime());
    assertEquals("2011-10-10 10:10:10", callLogSummary.getStartDateTime());
    assertEquals("English", callLogSummary.getLanguage());
    assertEquals("patientId", callLogSummary.getPatientId());
    assertEquals("1 Days, 1 Hours, and 1 Minutes", callLogSummary.getPatientDistanceFromClinic());
    assertEquals("40", callLogSummary.getAge());
    assertEquals("Male", callLogSummary.getGender());
  }
コード例 #2
0
  @Test
  public void shouldHaveUniqueMessageCategoriesAccessedInCall() {
    setUpCallLog(CallDirection.Outbound);

    CallEventCustomData customData = new CallEventCustomData();
    customData.add(TAMAIVRContext.MESSAGE_CATEGORY_NAME, TAMAMessageType.ALL_MESSAGES.name());

    CallEvent event = mock(CallEvent.class);
    when(event.getData()).thenReturn(customData);
    when(event.getTimeStamp()).thenReturn(startTime);

    callLog.setCallEvents(asList(event, event));

    CallLogSummary callLogSummary = callLogSummaryBuilder.build(callLog);
    assertEquals(
        TAMAMessageType.ALL_MESSAGES.getDisplayName(), callLogSummary.getMessageCategories());
  }