OCPStrategy implements FPMethodStrategy { @Override public void enrollToNewScheduleForNewFPMethod(FPProductInformation fpInfo) { enrollECToOCPRefillSchedule(fpInfo.entityId(), fpInfo.numberOfOCPStripsSupplied(), fpInfo.fpMethodChangeDate()); } @Autowired  OCPStrategy(ScheduleTrackingService scheduleTrackingService, ActionService actionService, ScheduleService scheduleService,
                       @Value("#{drishti['preferred.time']}") int preferredTime); @Override void registerEC(FPProductInformation fpInfo); @Override void unEnrollFromPreviousScheduleAsFPMethodChanged(FPProductInformation fpInfo); @Override void enrollToNewScheduleForNewFPMethod(FPProductInformation fpInfo); @Override void renewFPProduct(FPProductInformation fpInfo); @Override void fpFollowup(FPProductInformation fpInfo); static final int NUMBER_OF_PILLS_IN_ONE_OCP_STRIP; static final int DUE_WINDOW_PERIOD_IN_WEEKS; }
@Test public void shouldEnrollECIntoOCPRefillScheduleWhenFPMethodIsChanged() { fakeIt(parse("2012-02-01")); strategy.enrollToNewScheduleForNewFPMethod(new FPProductInformation("entity id 1", "anm id 1", "ocp", "condom", null, "1", null, null, null, "2012-01-01", null, null, null)); verify(scheduleService).enroll("entity id 1", "OCP Refill", "2012-01-15"); verify(actionService).alertForBeneficiary(ec, "entity id 1", "OCP Refill", "OCP Refill", upcoming, LocalDate.parse("2012-01-15").toDateTime(new LocalTime(14, 0)), LocalDate.parse("2012-01-15").plusWeeks(1).toDateTime(new LocalTime(14, 0))); }