@Test
  /*
   * If the student is attempting to register too late, the only field provided will be "endDate", which will be set as
   * the last available registration date formatted as a String M/dd/yyyy.
   *
   * Scenario:
   * -- Student is registering on 9/20
   * -- Non-appointment early registration set up 9/16-9/17
   * -- Scheduled adjustment period set up 9/18-9/19
   *
   * Expected result:
   * -- Student is given 9/19 as the registration end date
   */
  public void testTooLate() throws Exception {
    contextInfo.setCurrentDate(new DateTime(2014, 9, 20, 10, 18).toDate());

    CourseAddDates courseAddDates = getCourseAddDates();

    assertNotNull(courseAddDates);
    assertNotNull(courseAddDates.getEndDate());
    assertEquals("9/19/2014", courseAddDates.getEndDate());
  }
  @Before
  public void setUp() throws Exception {

    // create the term resolver
    courseAddDatesTermResolver = new CourseAddDatesTermResolver();

    // set up pre-requisites
    contextInfo = new ContextInfo();
    contextInfo.setCurrentDate(new DateTime(2014, 9, 15, 10, 18).toDate());
    String personId = "MOCK.PERSON";
    String atpId = "MOCK.ATP";
    resolvedPrereqs = new HashMap<>();
    resolvedPrereqs.put(RulesExecutionConstants.CONTEXT_INFO_TERM.getName(), contextInfo);
    resolvedPrereqs.put(RulesExecutionConstants.PERSON_ID_TERM.getName(), personId);
    resolvedPrereqs.put(RulesExecutionConstants.ATP_ID_TERM.getName(), atpId);

    // set up parameters
    parameters = new HashMap<>();

    // set up milestones
    List<MilestoneInfo> earlyRegMilestones = new ArrayList<>();
    String mstoneEarlyRegId = "milestone-early-reg";
    mstoneEarlyReg = new MilestoneInfo();
    mstoneEarlyReg.setId(mstoneEarlyRegId);
    earlyRegMilestones.add(mstoneEarlyReg);

    nonApptMilestones = new ArrayList<>();
    String mstoneNonApptId = "milestone-non-appt";
    MilestoneInfo mstoneNonAppt = new MilestoneInfo();
    mstoneNonAppt.setId(mstoneNonApptId);
    mstoneNonAppt.setStartDate(new DateTime(2014, 9, 16, 0, 1).toDate());
    mstoneNonAppt.setEndDate(new DateTime(2014, 9, 17, 11, 59).toDate());
    nonApptMilestones.add(mstoneNonAppt);

    List<MilestoneInfo> schedAdjMilestones = new ArrayList<>();
    String mstoneSchedAdjId = "milestone-sched-adj";
    MilestoneInfo mstoneSchedAdj = new MilestoneInfo();
    mstoneSchedAdj.setId(mstoneSchedAdjId);
    mstoneSchedAdj.setStartDate(new DateTime(2014, 9, 18, 0, 1).toDate());
    mstoneSchedAdj.setEndDate(new DateTime(2014, 9, 19, 11, 59).toDate());
    schedAdjMilestones.add(mstoneSchedAdj);

    // set up atp service
    AtpService atpService = mock(AtpService.class);
    when(atpService.getMilestonesByTypeForAtp(
            atpId, AtpServiceConstants.MILESTONE_EARLY_REGISTRATION_PERIOD_TYPE_KEY, contextInfo))
        .thenReturn(earlyRegMilestones);
    when(atpService.getMilestonesByTypeForAtp(
            atpId,
            AtpServiceConstants.MILESTONE_EARLY_REGISTRATION_PERIOD_NONAPPT_TYPE_KEY,
            contextInfo))
        .thenReturn(nonApptMilestones);
    when(atpService.getMilestonesByTypeForAtp(
            atpId, AtpServiceConstants.MILESTONE_SCHEDULE_ADJUSTMENT_PERIOD_TYPE_KEY, contextInfo))
        .thenReturn(schedAdjMilestones);

    // set up appointment slots
    appointmentSlots = new ArrayList<>();

    // set up appointment service
    AppointmentService appointmentService = mock(AppointmentService.class);
    when(appointmentService.getAppointmentSlotsByPersonAndPeriod(
            personId, mstoneEarlyRegId, contextInfo))
        .thenReturn(appointmentSlots);

    // add services to the term resolver
    courseAddDatesTermResolver.setAtpService(atpService);
    courseAddDatesTermResolver.setAppointmentService(appointmentService);
  }