ChildService { public void updateVitaminAProvided(FormSubmission submission) { serviceProvidedService.add( ServiceProvided.forVitaminAProvided(submission.entityId(), submission.getFieldValue(AllConstants.VitaminAFields.VITAMIN_A_DATE), submission.getFieldValue(AllConstants.VitaminAFields.VITAMIN_A_DOSE), submission.getFieldValue(AllConstants.VitaminAFields.VITAMIN_A_PLACE))); } ChildService(AllBeneficiaries allBeneficiaries, MotherRepository motherRepository, ChildRepository childRepository,
                        AllTimelineEvents allTimelineEvents, ServiceProvidedService serviceProvidedService, AllAlerts allAlerts); void register(FormSubmission submission); void registerForEC(FormSubmission submission); void pncRegistrationOA(FormSubmission submission); void updateImmunizations(FormSubmission submission); void pncVisitHappened(FormSubmission submission); void close(FormSubmission submission); void updatePhotoPath(String entityId, String imagePath); void updateIllnessStatus(FormSubmission submission); void updateVitaminAProvided(FormSubmission submission); void registerForOA(FormSubmission submission);  }
@Test public void shouldUpdateVitaminADosagesForUpdateVitaminAProvidedAction() throws Exception { FormSubmission submission = mock(FormSubmission.class); when(submission.entityId()).thenReturn("child id 1"); when(submission.getFieldValue("vitaminADate")).thenReturn("2012-01-01"); when(submission.getFieldValue("vitaminADose")).thenReturn("1"); when(submission.getFieldValue("vitaminAPlace")).thenReturn("PHC"); service.updateVitaminAProvided(submission); verify(serviceProvidedService).add(forVitaminAProvided("child id 1", "2012-01-01", "1", "PHC")); }