@Test
  public void testNoRecipients() {
    Notification notification = new Notification();
    DispatchCallback callback = EasyMock.createMock(DispatchCallback.class);
    notification.Callback = callback;

    List<String> callbackIds = new ArrayList<>();
    callbackIds.add(UUID.randomUUID().toString());
    notification.CallbackIds = callbackIds;

    callback.onFailure(callbackIds);

    EasyMock.expectLastCall();
    EasyMock.replay(callback);

    NotificationDispatcher dispatcher = m_dispatchFactory.getDispatcher(TargetType.EMAIL.name());
    dispatcher.dispatch(notification);

    EasyMock.verify(callback);
  }
Tests that an email without recipients causes a callback error.
ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/EmailDispatcherTest.java