@Test
public void testUpdateAlerts_StormUIWebAlert() {

  EasyMockSupport easyMockSupport = new EasyMockSupport();
  final AmbariManagementController mockAmbariManagementController = easyMockSupport.createNiceMock(AmbariManagementController.class);
  final Clusters mockClusters = easyMockSupport.createStrictMock(Clusters.class);
  final Cluster mockClusterExpected = easyMockSupport.createNiceMock(Cluster.class);
  final AlertDefinitionDAO mockAlertDefinitionDAO = easyMockSupport.createNiceMock(AlertDefinitionDAO.class);
  final AlertDefinitionEntity stormWebUIAlertMock = easyMockSupport.createNiceMock(AlertDefinitionEntity.class);
  final Injector mockInjector = createInjector(mockAmbariManagementController, mockClusters, mockAlertDefinitionDAO);
  long clusterId = 1;
  expect(mockAmbariManagementController.getClusters()).andReturn(mockClusters).once();
  expect(mockClusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
    put("normal", mockClusterExpected);
  }}).atLeastOnce();
  expect(mockClusterExpected.getClusterId()).andReturn(clusterId).anyTimes();
  expect(mockAlertDefinitionDAO.findByName(eq(clusterId), eq("storm_webui")))
      .andReturn(stormWebUIAlertMock).atLeastOnce();
  expect(stormWebUIAlertMock.getSource()).andReturn("{\"uri\": {\n" +
      "            \"http\": \"{{storm-site/ui.port}}\",\n" +
      "            \"kerberos_keytab\": \"{{storm-env/storm_ui_keytab}}\",\n" +
      "            \"kerberos_principal\": \"{{storm-env/storm_ui_principal_name}}\",\n" +
      "            \"connection_timeout\": 5.0\n" +
      "          } }");
  stormWebUIAlertMock.setSource("{\"uri\":{\"http\":\"{{storm-site/ui.port}}\",\"kerberos_keytab\":\"{{storm-env/storm_ui_keytab}}\",\"kerberos_principal\":\"{{storm-env/storm_ui_principal_name}}\",\"connection_timeout\":5.0,\"https\":\"{{storm-site/ui.https.port}}\",\"https_property\":\"{{storm-site/ui.https.keystore.type}}\",\"https_property_value\":\"jks\"}}");
  expectLastCall().once();
  easyMockSupport.replayAll();
  mockInjector.getInstance(UpgradeCatalog250.class).updateStormAlerts();
  easyMockSupport.verifyAll();
}