@Test
  public void testAlertFiresOKEvent() {
    // instantiate and inject mocks
    AmbariPerformanceRunnable runnable = new AmbariPerformanceRunnable(
        m_definition.getDefinitionName());

    m_injector.injectMembers(runnable);

    // run the alert
    runnable.run();

    assertEquals(1, m_listener.getAlertEventReceivedCount(AlertReceivedEvent.class));

    List<AlertEvent> events = m_listener.getAlertEventInstances(AlertReceivedEvent.class);
    assertEquals(1, events.size());

    AlertReceivedEvent event = (AlertReceivedEvent) events.get(0);
    Alert alert = event.getAlert();
    assertEquals("AMBARI", alert.getService());
    assertEquals("AMBARI_SERVER", alert.getComponent());
    assertEquals(DEFINITION_NAME, alert.getName());

    verify(m_cluster, m_clusters, m_definitionDao);
  }
Tests that the event is triggerd with a status of OK if all performance
areas pass.
ambari-server/src/test/java/org/apache/ambari/server/alerts/AmbariPerformanceRunnableTest.java