@Test
  public void shouldGetPeriodContainingADateForASchedule() throws Exception {
    Date currentDate = new Date();
    ProcessingPeriod period =
        make(
            a(
                defaultProcessingPeriod,
                with(startDate, addDays(currentDate, -1)),
                with(endDate, addDays(currentDate, 5)),
                with(scheduleId, schedule.getId()),
                with(name, "Month1")));
    mapper.insert(period);

    ProcessingPeriod periodForDate = mapper.getPeriodForDate(period.getScheduleId(), currentDate);

    assertThat(periodForDate, is(period));
  }