EligibleCoupleService { public void closeEligibleCouple(FormSubmission submission) { allEligibleCouples.close(submission.entityId()); allBeneficiaries.closeAllMothersForEC(submission.entityId()); } EligibleCoupleService(AllEligibleCouples allEligibleCouples, AllTimelineEvents allTimelineEvents, AllBeneficiaries allBeneficiaries); void register(FormSubmission submission); void fpComplications(FormSubmission submission); void fpChange(FormSubmission submission); void renewFPProduct(FormSubmission submission); void closeEligibleCouple(FormSubmission submission);  }
@Test public void shouldCloseEC() throws Exception { FormSubmission submission = mock(FormSubmission.class); when(submission.entityId()).thenReturn("entity id 1"); service.closeEligibleCouple(submission); verify(allEligibleCouples).close("entity id 1"); verify(allBeneficiaries).closeAllMothersForEC("entity id 1"); }