private void expectUpgradeSuspendedCluster() throws Exception {
    Cluster cluster = createMock(Cluster.class);
    Clusters clusters = injector.getInstance(Clusters.class);

    EasyMock.reset(clusters);

    EasyMock.expect(clusters.getClusterById(EasyMock.anyLong())).andReturn(cluster).atLeastOnce();
    EasyMock.expect(cluster.getUpgradeInProgress()).andReturn(EasyMock.createMock(UpgradeEntity.class)).anyTimes();
    EasyMock.expect(cluster.isUpgradeSuspended()).andReturn(true).anyTimes();
  }
Create expectations around a cluster where the upgrade was suspended.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/state/alerts/AlertStateChangedEventTest.java