### Question:
SingleRepositoryServiceImpl implements SingleRepositoryService { @Override public void deleteResource(String uri) throws IllegalParameterValueException, AccessDeniedException { if (uri == null || "".equals(uri)) { throw new IllegalParameterValueException("uri", uri); } if(uriHardModifyProtectionChecker.isHardModifyProtected(uri)){ throw new AccessDeniedException("", uri); } try { Resource resource = repositoryService.getResource(null, uri); if (resource != null) { List<ResourceLookup> dependentResources = repositoryService.getDependentResources(null, uri, searchCriteriaFactory, 0, 0); if (dependentResources == null || dependentResources.isEmpty() || isAllTemporary(dependentResources)){ if (dependentResources != null){ for (ResourceLookup resourceLookup: dependentResources){ repositoryService.deleteResource(null, resourceLookup.getURIString()); } } repositoryService.deleteResource(null, uri); } else { throw new ResourceInUseException(dependentResources); } } else { resource = repositoryService.getFolder(null, uri); if (resource != null) { repositoryService.deleteFolder(null, uri); } } } catch (org.springframework.security.access.AccessDeniedException sse) { throw new AccessDeniedException(uri); } catch (JSExceptionWrapper w){ throw getRootException(w); } }  @Override Resource getResource(String uri); @Override FileResourceData getFileResourceData(String uri); @Override FileResourceData getFileResourceData(Resource resource); @Override void deleteResource(String uri); @Override Resource createResource(Resource serverResource, String parentUri, boolean createFolders, boolean dryRun); ClientResource saveOrUpdate(ClientResource clientResource, boolean overwrite, boolean createFolders,
            String clientType, boolean dryRun, Map<String, String[]> additionalProperties); @Override Resource updateResource(Resource resource, boolean dryRun); @Override String copyResource(String sourceUri, String destinationUri, boolean createFolders, boolean overwrite, String renameTo); @Override String moveResource(String sourceUri, String destinationUri, boolean createFolders, boolean overwrite,
            String renameTo); @Override Resource createFileResource(InputStream stream, String parentFolderUri, String name, String label,
            String description, String type, boolean createFolders, boolean dryRun); @Override Resource updateFileResource(InputStream stream, String parentUri, String name, String label, String description, String type, boolean dryRun); @Override String getUniqueName(String parenUri, String name);  }### Answer:
@Test(groups = "DELETE", expectedExceptions = {AccessDeniedException.class}) public void testDeleteResource_modifyProtected() throws Exception{ final String testUri = "testUri"; when(uriHardModifyProtectionChecker.isHardModifyProtected(testUri)).thenReturn(true); service.deleteResource(testUri); Mockito.verify(repositoryService).deleteResource(Mockito.nullable(ExecutionContext.class), Mockito.eq(uri)); }
@Test(groups = "DELETE", expectedExceptions = {IllegalParameterValueException.class}) public void testDeleteResource_Null() throws Exception{ service.deleteResource(null); }
@Test(groups = "DELETE", expectedExceptions = {IllegalParameterValueException.class}) public void testDeleteResource_Empty() throws Exception{ service.deleteResource(""); }