@Test
  public void testNonAlertNotification() throws Exception {
    DispatchCallback callback = EasyMock.createNiceMock(DispatchCallback.class);
    Notification notification = EasyMock.createNiceMock(Notification.class);
    notification.Callback = callback;
    notification.CallbackIds = Collections.singletonList(UUID.randomUUID().toString());

    callback.onFailure(notification.CallbackIds);
    EasyMock.expectLastCall().once();

    EasyMock.replay(callback, notification);

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

    EasyMock.verify(callback, notification);
  }
Tests that a callback error happens when the notification is not an
{@link AlertNotification}.
ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java