@Test
public void testDeleteResources() throws Exception {

  IvoryService service = createMock(IvoryService.class);
  List<String> targetClusterNames = new LinkedList<String>();
  targetClusterNames.add("Cluster1");
  Cluster.Interface interface1 = new Cluster.Interface("type", "endpoint", "version");
  Cluster.Location  location1  = new Cluster.Location("name", "path");
  Cluster targetCluster1 = new Cluster("Cluster1", "Colo", Collections.singleton(interface1),
      Collections.singleton(location1), Collections.singletonMap("P1", "V1"));
  // set expectations
  expect(service.getClusterNames()).andReturn(targetClusterNames);
  expect(service.getCluster("Cluster1")).andReturn(targetCluster1);
  service.deleteCluster("Cluster1");
  // replay
  replay(service);
  TargetClusterResourceProvider provider = new TargetClusterResourceProvider(service,
      PropertyHelper.getPropertyIds(Resource.Type.DRTargetCluster),
      PropertyHelper.getKeyPropertyIds(Resource.Type.DRTargetCluster));
  Predicate predicate = new PredicateBuilder().property(TargetClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID).equals("Cluster1").toPredicate();
  provider.deleteResources(new RequestImpl(null, null, null, null), predicate);
  // verify
  verify(service);
}