### Question:
ResourceLookupContextStrategy implements
        ContextManagementStrategy<ClientResourceLookup, ClientResourceLookup>,
        ContextQueryExecutor<Object, ClientResourceLookup>, GenericTypeMetadataBuilder<ClientResourceLookup>,
        ContextParametrizedMetadataBuilder<ClientResourceLookup, Object> { protected ClientResource getFullClientResource(ClientResourceLookup resourceLookup){ ClientResource clientResource = null; if(resourceLookup != null){ if (resourceLookup.getUri() == null) { throw new MandatoryParameterNotFoundException("uri"); } if(profileAttributesResolver.containsAttribute(resourceLookup.getUri())){ throw new IllegalParameterValueException("uri", resourceLookup.getUri()); } Resource repositoryResource = null; try { String uri = resourceLookup.getUri(); if (uri.isEmpty() || !uri.startsWith(Folder.SEPARATOR)) { throw new ReferencedResourceNotFoundException(resourceLookup.getUri(), "uri"); } repositoryResource = repository .getResource(ExecutionContextImpl.getRuntimeExecutionContext(), resourceLookup.getUri()); } catch (AccessDeniedException e) { throw new ReferencedResourceAccessDeniedException(resourceLookup.getUri(), "uri"); } if(repositoryResource != null) { String clientType = resourceLookup.getResourceType(); ToClientConverter<? super Resource, ? extends ClientResource, ToClientConversionOptions> toClientConverter; if (clientType != null) { toClientConverter = resourceConverterProvider.getToClientConverter(repositoryResource.getResourceType(), clientType); } else { toClientConverter = resourceConverterProvider.getToClientConverter(repositoryResource.getResourceType()); clientType = toClientConverter.getClientResourceType(); } if (contextsManager.getContextDescriptionClass(clientType) == null) { throw new ResourceTypeNotSupportedException(clientType); } clientResource = toClientConverter .toClient(repositoryResource, getToClientConversionOptionsForFullResource()); } else { throw new ReferencedResourceNotFoundException(resourceLookup.getUri(), "uri"); } } return clientResource; }  @Override boolean isMetadataSupported(ClientResourceLookup resourceLookup, String metadataClientType); @Override String getMetadataClientResourceType(ClientResourceLookup connectionDescription); @Override ClientResourceLookup createContext(ClientResourceLookup contextDescription, Map<String, Object> data); @Override void deleteContext(ClientResourceLookup contextDescription, Map<String, Object> data); @Override ClientResourceLookup getContextForClient(ClientResourceLookup contextDescription, Map<String, Object> data, Map<String, String[]> additionalProperties); @Override Object build(ClientResourceLookup context, Map<String, String[]> options, Map<String, Object> contextData); @Override Object build(ClientResourceLookup connection, Object options, Map<String, Object> contextData); @Override Object executeQuery(Object query, ClientResourceLookup connection, Map<String, String[]> queryParameters, Map<String, Object> data); @Override Object executeQueryForMetadata(Object query, ClientResourceLookup connection, Map<String, Object> data);  }### Answer:
@Test(expectedExceptions = ReferencedResourceAccessDeniedException.class) public void getFullClientResource_AccessDenied() throws ReferencedResourceAccessDeniedException { ClientResourceLookup clientResourceLookup = new ClientResourceLookup(); clientResourceLookup.setUri("/Domains/Simple_Domain"); when(repository.getResource(any(ExecutionContext.class), any(String.class))).thenThrow(new AccessDeniedException("NO")); strategy.getFullClientResource(clientResourceLookup); }