@Test
  public void testClusterRenameEvent() throws Exception {
    Class<? extends AmbariEvent> eventClass = ClusterEvent.class;
    installHdfsService();

    Assert.assertFalse(m_listener.isAmbariEventReceived(eventClass));
    m_cluster.setClusterName(UUID.randomUUID().toString());

    Assert.assertTrue(m_listener.isAmbariEventReceived(eventClass));
    List<AmbariEvent> ambariEvents = m_listener.getAmbariEventInstances(eventClass);
    Assert.assertEquals(1, ambariEvents.size());
    Assert.assertEquals(AmbariEventType.CLUSTER_RENAME, ambariEvents.get(0).getType());
  }
Tests that {@link ServiceComponentUninstalledEvent}s are fired correctly.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/events/EventsTest.java