@Test public void menuRepeatURLShouldBeReturnedAfterPushOfMessages() { tamaIVRContext.callState(CallState.PUSH_MESSAGES_COMPLETE); String patientId = "1234"; tamaIVRContext.patientDocumentId(patientId); assertEquals(ControllerURLs.MENU_REPEAT, tamaCallFlowController.urlFor(kooKooIVRContext)); }
@Before public void setUp() { initMocks(this); ivrContext = new TAMAIVRContextForTest().patientDocumentId("patientDocId"); Patient patient = PatientBuilder.startRecording() .withDefaults() .withId(ivrContext.patientDocumentId()) .build(); when(allPatients.get(ivrContext.patientDocumentId())).thenReturn(patient); when(clinicMessageBuilder.getInboundMessage(any(Clinic.class), any(IVRLanguage.class))) .thenReturn(EXPECTED_WELCOME_MESSAGE); incomingWelcomeMessage = new IncomingWelcomeMessage(allPatients, allClinics, clinicMessageBuilder); }
@Test public void outboxURLShouldBeReturnedWhenTheDecisionTreesAreComplete() { tamaIVRContext.callState(CallState.ALL_TREES_COMPLETED); tamaIVRContext.callDirection(CallDirection.Outbound); String patientId = "1234"; tamaIVRContext.patientDocumentId(patientId); Patient patient = PatientBuilder.startRecording() .withDefaults() .withId(patientId) .withCallPreference(CallPreference.DailyPillReminder) .build(); when(allPatients.get(patientId)).thenReturn(patient); assertEquals(ControllerURLs.PUSH_MESSAGES_URL, tamaCallFlowController.urlFor(kooKooIVRContext)); }