@Test
public void testAddSliderClientConfig() throws Exception{

  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 ConfigHelper configHelper = easyMockSupport.createNiceMock(ConfigHelper.class);
  final Service serviceSlider = easyMockSupport.createNiceMock(Service.class);
  Map<String, Service> servicesMap = new HashMap<>();
  servicesMap.put("SLIDER", serviceSlider);
  final Injector mockInjector = Guice.createInjector(new AbstractModule() {
    @Override
    protected void configure() {
      bind(AmbariManagementController.class).toInstance(mockAmbariManagementController);
      bind(PasswordEncoder.class).toInstance(createMock(PasswordEncoder.class));
      bind(Clusters.class).toInstance(mockClusters);
      bind(EntityManager.class).toInstance(entityManager);
      bind(DBAccessor.class).toInstance(createNiceMock(DBAccessor.class));
      bind(OsFamily.class).toInstance(createNiceMock(OsFamily.class));
      bind(HookContextFactory.class).toInstance(createMock(HookContextFactory.class));
      bind(HookService.class).toInstance(createMock(HookService.class));
    }
  });
  expect(mockAmbariManagementController.getClusters()).andReturn(mockClusters).once();
  expect(mockClusters.getClusters()).andReturn(new HashMap<String, Cluster>() {{
    put("normal", mockClusterExpected);
  }}).atLeastOnce();
  expect(mockAmbariManagementController.getConfigHelper()).andReturn(configHelper).once();
  expect(mockClusterExpected.getServices()).andReturn(servicesMap).once();
  expect(mockClusterExpected.getDesiredConfigByType("slider-client")).andReturn(null).once();
  configHelper.createConfigType(mockClusterExpected, mockAmbariManagementController, "slider-client",
          new HashMap<String, String>(), "ambari-upgrade", "");
  expectLastCall().once();
  easyMockSupport.replayAll();
  mockInjector.getInstance(UpgradeCatalog240.class).addSliderClientConfig();
  easyMockSupport.verifyAll();
}