ANCSchedulesService { public void enrollMother(String caseId, LocalDate referenceDateForSchedule) { for (String schedule : NON_ANC_SCHEDULES) { scheduleService.enroll(caseId, schedule, referenceDateForSchedule.toString()); } enrollIntoCorrectMilestoneOfANCCare(caseId, referenceDateForSchedule); } @Autowired  ANCSchedulesService(ScheduleTrackingService trackingService, ActionService actionService, ScheduleService scheduleService); void enrollMother(String caseId, LocalDate referenceDateForSchedule); void ancVisitHasHappened(String entityId, String anmId, int visitNumberToFulfill, String visitDate); void deliveryHasBeenPlanned(String entityId, String anmId, String deliveryPlanDate); void ttVisitHasHappened(String entityId, String anmId, String ttDose, String ttDate); void ifaTabletsGiven(String entityId, String anmId, String numberOfIFATabletsGiven, String ifaGivenDate); void hbTestDone(String entityId, String anmId, String date, String anaemicStatus, LocalDate lmp); void forceFulfillMilestone(String externalId, String scheduleName); void unEnrollFromAllSchedules(String entityId); static final int NUMBER_OF_WEEKS_BEFORE_HB_TEST_2_BECOMES_DUE; }
@Test public void shouldEnrollMotherIntoSchedules() { fakeIt(parse("2012-01-01")); LocalDate lmp = today().minusDays(3); ancSchedulesService.enrollMother("Case X", lmp); verify(scheduleService).enroll("Case X", SCHEDULE_ANC, "ANC 1", lmp.toString()); verifyNonANCScheduleEnrollments(lmp); verifyNoMoreInteractions(trackingService); }