Esempio n. 1
0
  @Test
  public void shouldAddNextEvent() {
    CallEventView firstEventView = new CallEventView(new CallEvent(IVREvent.GotDTMF.toString()));
    CallEventView secondEventView = new CallEventView(new CallEvent(IVREvent.GotDTMF.toString()));
    CallEventView thirdEventView = new CallEventView(new CallEvent(IVREvent.GotDTMF.toString()));

    callFlowGroupView = new CallFlowGroupView("flow", firstEventView);
    callFlowGroupView.add(secondEventView);
    callFlowGroupView.add(thirdEventView);

    assertEquals(secondEventView, firstEventView.getNextEvent());
    assertEquals(thirdEventView, secondEventView.getNextEvent());
    assertEquals(null, thirdEventView.getNextEvent());
  }
Esempio n. 2
0
  @Test
  public void shouldReturnCallFlowDuration() {
    callEventView = new CallEventView(new CallEvent(IVREvent.GotDTMF.toString()));
    callFlowGroupView = new CallFlowGroupView("flow", callEventView);
    DateTime flowStartTime = DateUtil.now();

    callFlowGroupView.setFlowStartTime(flowStartTime);
    callFlowGroupView.setFlowEndTime(flowStartTime.plusMinutes(2).plusSeconds(3));

    assertEquals(123, callFlowGroupView.getFlowDuration());
    assertEquals("flow", callFlowGroupView.toString());
  }