Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
   }
 }
Ejemplo n.º 3
0
  @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());
  }