コード例 #1
0
  @Test
  public void shouldFulfillAMilestoneAndAlertsForTheOneDueNext() {
    LocalDate enrollmentDate = LocalDate.now().minusWeeks(16);
    LocalDate firstFulfillmentDate = LocalDate.now().minusWeeks(3);
    Enrollment enrollment = schedule.newEnrollment("External ID", enrollmentDate);
    String nextMilestone = enrollment.fulfillMilestone(schedule, firstFulfillmentDate);
    assertThat(nextMilestone, is(equalTo("IPTI 2")));

    List<Alert> alerts = enrollment.getAlerts(schedule);
    assertThat(alerts.size(), is(equalTo(1)));
    Alert alert = alerts.get(0);
    assertThat(alert.windowName(), is(equalTo(WindowName.Due)));
    Map<String, String> data = alert.data();
    assertThat(data.get("doo"), is(equalTo("Bar")));
  }
コード例 #2
0
 private List<Alert> enrollAndGetAlerts(int numberOfWeeksSinceEnrollment) {
   LocalDate fewWeeksAgo = LocalDate.now().minusWeeks(numberOfWeeksSinceEnrollment);
   Enrollment enrollment = schedule.newEnrollment("External ID", fewWeeksAgo);
   return enrollment.getAlerts(schedule);
 }