private NotificationTask findTaskWithEmail(NotificationTask[] tasks, String email) throws Exception { assertNotNull(email); for (NotificationTask task : tasks) { assertNotNull(task); if (email.equals(task.getEmail())) { return task; } } return null; }
private void assertStartInterval(NotificationTask[] tasks, long startTime, long interval) { assertNotNull(tasks); long expectedTime = startTime; for (NotificationTask task : tasks) { assertEquals( "Expected task " + task + " to have sendTime " + expectedTime, expectedTime, task.getSendTime()); expectedTime += interval; } }
@Test public void testMakeUserTask() throws Exception { long startTime = now(); NotificationTask task = m_eventProcessor.makeUserTask( startTime, m_params, 1, "brozow", m_commands, new LinkedList<NotificationTask>(), null); assertNotNull(task); assertEquals("*****@*****.**", task.getEmail()); assertEquals(startTime, task.getSendTime()); }