ActionService { public List<Action> getNewAlertsForANM(String anmIdentifier, long timeStamp) { return allActions.findByANMIDAndTimeStamp(anmIdentifier, timeStamp); } @Autowired  ActionService(AllActions allActions, AllMothers allMothers, AllChildren allChildren, AllEligibleCouples allEligibleCouples); List<Action> getNewAlertsForANM(String anmIdentifier, long timeStamp); void alertForBeneficiary(BeneficiaryType beneficiaryType, String caseID, String scheduleName, String visitCode, AlertStatus alertStatus, DateTime startDate, DateTime expiryDate); void markAllAlertsAsInactive(String entityId); void markAlertAsInactive(String anmId, String entityId, String scheduleName); void markAlertAsClosed(String caseId, String anmIdentifier, String visitCode, String completionDate); void closeMother(String caseId, String anmIdentifier, String reasonForClose); void reportForIndicator(String anmIdentifier, ActionData actionData); void deleteReportActions();  }
@Test public void shouldReturnAlertsBasedOnANMIDAndTimeStamp() throws Exception { List<Action> alertActions = Arrays.asList(new Action("Case X", "ANM 1", ActionData.createAlert(mother, "Ante Natal Care - Normal", "ANC 1", normal, DateTime.now(), DateTime.now().plusDays(3)))); when(allActions.findByANMIDAndTimeStamp("ANM 1", 1010101)).thenReturn(alertActions); List<Action> alerts = service.getNewAlertsForANM("ANM 1", 1010101); assertEquals(1, alerts.size()); assertEquals(alertActions, alerts); }