MCTSSMSService { public void send(MCTSServiceCode typeOfService, String thayiCardNumber, LocalDate date) { smsService.sendSMS(mctsPhoneNumber, typeOfService.messageFor(thayiCardNumber, date)); } @Autowired  MCTSSMSService(DrishtiSMSService smsService, @Value("#{drishti['mcts.phone.number']}") String mctsPhoneNumber); void send(MCTSServiceCode typeOfService, String thayiCardNumber, LocalDate date); void send(String smsText);  }
@Test public void shouldSendSMSBasedOnCodeForANC1() { mctsSMSService.send(MCTSServiceCode.ANC1, "1234567", DateUtil.newDate(2012, 3, 21)); verify(smsService).sendSMS("9986048731", "ANMPW 1234567 ANC1 210312"); }
@Test public void shouldSendSMSWithZeroPaddedDateWhenDateIsBefore10th() { mctsSMSService.send(MCTSServiceCode.ANC1, "1234567", DateUtil.newDate(2012, 3, 8)); verify(smsService).sendSMS("9986048731", "ANMPW 1234567 ANC1 080312"); }
@Test public void shouldSendSMSWithGivenText() { mctsSMSService.send("SMS Text"); verify(smsService).sendSMS("9986048731", "SMS Text"); }