MCTSReporter { public void report(String entityId, String thayiCardNumber, String indicator, String registrationDate, String serviceProvidedDate) { MCTSReport report = new MCTSReport(entityId, MCTSServiceCode.valueOf(indicator).messageFor(thayiCardNumber, LocalDate.parse(serviceProvidedDate)), registrationDate, serviceProvidedDate, getSendDate(LocalDate.parse(serviceProvidedDate))); reports.add(report); } @Autowired  MCTSReporter(AllMCTSReports reports, @Value("#{drishti['mcts-report-delay-in-days']}") String mctsReportDelay); void report(String entityId, String thayiCardNumber, String indicator,
                       String registrationDate, String serviceProvidedDate); static final int DEFAULT_MCTS_REPORT_DELAY; }
@Test public void shouldSaveMCTSReportAfterTenDaysWhenServiceIsProvidedWithinTenDaysOfRegistration() { reporter.report("mother id 1", "7777777", "ANC1", "2014-01-01", "2014-01-05"); verify(allMCTSReports).add(new MCTSReport("mother id 1", "ANMPW 7777777 ANC1 050114", "2014-01-01", "2014-01-05", "2014-01-15")); }
@Test public void shouldSaveMCTSReportWithSendDateAsTenDaysFromServiceProvidedDate() { reporter.report("mother id 1", "7777777", "ANC1", "2014-01-01", "2014-01-05"); verify(allMCTSReports).add(new MCTSReport("mother id 1", "ANMPW 7777777 ANC1 050114", "2014-01-01", "2014-01-05", "2014-01-15")); }