@Test
@Ignore
public void testUpdateClustersWithNullConfigPropertyValues() throws Exception {

  // member state mocks
  Capture<AmbariManagementController> controllerCapture = EasyMock.newCapture();
  Injector injector = createStrictMock(Injector.class);
  Cluster cluster = createNiceMock(Cluster.class);
  ActionManager actionManager = createNiceMock(ActionManager.class);
  ClusterRequest clusterRequest = createNiceMock(ClusterRequest.class);
  Config config = createNiceMock(Config.class);
  // requests
  Set<ClusterRequest> setRequests = Collections.singleton(clusterRequest);
  KerberosHelper kerberosHelper = createStrictMock(KerberosHelper.class);
  // expectations
  injector.injectMembers(capture(controllerCapture));
  expect(injector.getInstance(Gson.class)).andReturn(null);
  expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(null);
  expect(injector.getInstance(KerberosHelper.class)).andReturn(kerberosHelper);
  expect(clusterRequest.getClusterName()).andReturn("clusterNew").anyTimes();
  expect(clusterRequest.getClusterId()).andReturn(1L).anyTimes();
  ConfigurationRequest configReq = new ConfigurationRequest();
  final Map<String, String> configReqProps = Maps.newHashMap();
  configReqProps.put("p1", null);
  configReq.setProperties(configReqProps);
  expect(clusterRequest.getDesiredConfig()).andReturn(ImmutableList.of(configReq)).anyTimes();
  expect(clusters.getClusterById(1L)).andReturn(cluster).anyTimes();
  expect(cluster.getClusterName()).andReturn("clusterOld").anyTimes();
  expect(cluster.getConfigPropertiesTypes(anyObject(String.class))).andReturn(Maps.<PropertyInfo.PropertyType, Set<String>>newHashMap()).anyTimes();
  expect(config.getType()).andReturn("config-type").anyTimes();
  expect(config.getProperties()).andReturn(configReqProps).anyTimes();
  expect(config.getPropertiesAttributes()).andReturn(new HashMap<String,Map<String,String>>()).anyTimes();
  expect(cluster.getDesiredConfigByType(anyObject(String.class))).andReturn(config).anyTimes();
  cluster.addSessionAttributes(EasyMock.<Map<String, Object>>anyObject());
  expectLastCall().once();
  cluster.setClusterName("clusterNew");
  expectLastCall();
  // replay mocks
  replay(actionManager, cluster, clusters, config, injector, clusterRequest, sessionManager);
  // test
  AmbariManagementController controller = new AmbariManagementControllerImpl(actionManager, clusters, injector);
  controller.updateClusters(setRequests, null);
  // assert and verify
  assertSame(controller, controllerCapture.getValue());
  verify(actionManager, cluster, clusters, config, injector, clusterRequest, sessionManager);
}