ChildService { public void close(FormSubmission submission) { allBeneficiaries.closeChild(submission.entityId()); } 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 shouldCloseChildRecordForDeleteChildAction() throws Exception { FormSubmission submission = mock(FormSubmission.class); when(submission.entityId()).thenReturn("child id 1"); service.close(submission); verify(allBeneficiaries).closeChild("child id 1"); }