AllEligibleCouples { public void close(String entityId) { alertRepository.deleteAllAlertsForEntity(entityId); timelineEventRepository.deleteAllTimelineEventsForEntity(entityId); eligibleCoupleRepository.close(entityId); } AllEligibleCouples(EligibleCoupleRepository eligibleCoupleRepository, AlertRepository alertRepository, TimelineEventRepository timelineEventRepository); List<EligibleCouple> all(); EligibleCouple findByCaseID(String caseId); long count(); long fpCount(); List<String> villages(); List<EligibleCouple> findByCaseIDs(List<String> caseIds); void updatePhotoPath(String caseId, String imagePath); void close(String entityId); void mergeDetails(String entityId, Map<String, String> details);  }
@Test public void shouldCloseEC() throws Exception { allEligibleCouples.close("entity id 1"); verify(alertRepository).deleteAllAlertsForEntity("entity id 1"); verify(eligibleCoupleRepository).close("entity id 1"); verify(timelineEventRepository).deleteAllTimelineEventsForEntity("entity id 1"); }