### Question:
ContentNegotiationHandler { protected Resource getResource(ClientResourceLookup resourceLookup){ final String uri = resourceLookup.getUri(); if(uri == null || uri.isEmpty()){ throw new MandatoryParameterNotFoundException("uri"); } final Resource resource = repository.getResource(ExecutionContextImpl.getRuntimeExecutionContext(), uri); if(resource == null){ throw new ReferencedResourceNotFoundException(uri, "uri"); } return resource; }  boolean isAcceptable(Object sourceObject, String sourceMimeType, String targetMimeType); Object handle(Object sourceObject, String sourceMimeType, String targetMimeType,
            Map<String, String[]> additionalProperties);  }### Answer:
@Test(expectedExceptions = MandatoryParameterNotFoundException.class) public void getResource_noUri_exception(){ handler.getResource(new ClientResourceLookup()); }
@Test(expectedExceptions = ReferencedResourceNotFoundException.class) public void getResource_withUriResourceNotFound_exception(){ final String uri = "someUri"; doReturn(null).when(repository).getResource(any(ExecutionContext.class), eq(uri)); handler.getResource(new ClientResourceLookup().setUri(uri)); }
@Test public void getResource_withUriResourceFound_success(){ final String uri = "someUri"; final FolderImpl resource = new FolderImpl(); doReturn(resource).when(repository).getResource(any(ExecutionContext.class), eq(uri)); final Resource result = handler.getResource(new ClientResourceLookup().setUri(uri)); assertSame(result, resource); }