@Test
public void testUpdateResources() throws Exception {

  IvoryService service = createMock(IvoryService.class);
  Set<Map<String, Object>> propertySet = new HashSet<Map<String, Object>>();
  Map<String, Object> properties = new HashMap<String, Object>();
  properties.put(TargetClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID, "Cluster1");
  properties.put(TargetClusterResourceProvider.CLUSTER_COLO_PROPERTY_ID, "Colo");
  properties.put(TargetClusterResourceProvider.CLUSTER_INTERFACES_PROPERTY_ID, Collections.singleton(interfaces));
  properties.put(TargetClusterResourceProvider.CLUSTER_LOCATIONS_PROPERTY_ID, Collections.singleton(locations));
  properties.put(TargetClusterResourceProvider.CLUSTER_PROPERTIES_PROPERTY_ID + "/P1", "V1");
  List<String> targetClusterNames = new LinkedList<String>();
  targetClusterNames.add("Cluster1");
  Set<Cluster.Interface> interfaceSet = Collections.singleton(interface1);
  Set<Cluster.Location>  locationSet  = Collections.singleton(location1);
  Cluster targetCluster1 = new Cluster("Cluster1", "Colo", interfaceSet,
      locationSet, Collections.singletonMap("P1", "V1"));
  // set expectations
  expect(service.getClusterNames()).andReturn(targetClusterNames);
  expect(service.getCluster("Cluster1")).andReturn(targetCluster1);
  service.updateCluster(targetCluster1);
  // replay
  replay(service);
  propertySet.add(properties);
  Request request = PropertyHelper.getCreateRequest(propertySet, Collections.<String,String>emptyMap());
  TargetClusterResourceProvider provider = new TargetClusterResourceProvider(service,
      PropertyHelper.getPropertyIds(Resource.Type.DRTargetCluster),
      PropertyHelper.getKeyPropertyIds(Resource.Type.DRTargetCluster));
  provider.updateResources(request, null);
  // verify
  verify(service);
}