### Question:
TargetClusterResourceProvider extends AbstractDRResourceProvider { @Override public RequestStatus deleteResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException { IvoryService service = getService(); Set<Resource> resources = getResources(PropertyHelper.getReadRequest(), predicate); for (Resource resource : resources) { service.deleteCluster((String) resource.getPropertyValue(CLUSTER_NAME_PROPERTY_ID)); } return new RequestStatusImpl(null); } TargetClusterResourceProvider(IvoryService ivoryService); @Override RequestStatus createResources(Request request); @Override Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus updateResources(Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate);  }### Answer:
@Test public void testDeleteResources() throws Exception { IvoryService service = createMock(IvoryService.class); List<String> targetClusterNames = new LinkedList<>(); 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")); expect(service.getClusterNames()).andReturn(targetClusterNames); expect(service.getCluster("Cluster1")).andReturn(targetCluster1); service.deleteCluster("Cluster1"); replay(service); TargetClusterResourceProvider provider = new TargetClusterResourceProvider(service); Predicate predicate = new PredicateBuilder().property(TargetClusterResourceProvider.CLUSTER_NAME_PROPERTY_ID).equals("Cluster1").toPredicate(); provider.deleteResources(new RequestImpl(null, null, null, null), predicate); verify(service); }