@Test
public void testUpdateAlerts_LogSearchUIWebAlert() {

  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 logSearchWebUIAlertMock = 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("logsearch_ui")))
    .andReturn(logSearchWebUIAlertMock).atLeastOnce();
  expect(logSearchWebUIAlertMock.getSource()).andReturn("{\"uri\": {\n" +
    "            \"http\": \"{{logsearch-env/logsearch_ui_port}}\",\n" +
    "            \"https\": \"{{logsearch-env/logsearch_ui_port}}\"\n" +
    "          } }");
  logSearchWebUIAlertMock.setSource("{\"uri\":{\"http\":\"{{logsearch-env/logsearch_ui_port}}\",\"https\":\"{{logsearch-env/logsearch_ui_port}}\",\"https_property\":\"{{logsearch-env/logsearch_ui_protocol}}\",\"https_property_value\":\"https\"}}");
  expectLastCall().once();
  easyMockSupport.replayAll();
  mockInjector.getInstance(UpgradeCatalog250.class).updateLogSearchAlert();
  easyMockSupport.verifyAll();
}