@Test void testTrellisRequest() { final URI uri = create("http: final MultivaluedMap<String, String> headers = new MultivaluedHashMap<>(); headers.add("Content-Type", RdfMediaType.TEXT_TURTLE); final MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>(); queryParams.add("ext", "foo"); final MultivaluedMap<String, String> pathParams = new MultivaluedHashMap<>(); pathParams.add("path", "resource"); when(mockUriInfo.getPath()).thenReturn("resource"); when(mockUriInfo.getPathParameters()).thenReturn(pathParams); when(mockUriInfo.getQueryParameters()).thenReturn(queryParams); when(mockUriInfo.getBaseUri()).thenReturn(uri); when(mockHeaders.getRequestHeaders()).thenReturn(headers); when(mockRequest.getMethod()).thenReturn(GET); when(mockHeaders.getAcceptableMediaTypes()).thenReturn(singletonList(RdfMediaType.TEXT_TURTLE_TYPE)); final TrellisRequest req = new TrellisRequest(mockRequest, mockUriInfo, mockHeaders); assertEquals("http: assertEquals(headers, req.getHeaders()); assertTrue(req.getAcceptableMediaTypes().contains(RdfMediaType.TEXT_TURTLE_TYPE)); assertEquals(GET, req.getMethod()); assertNull(req.getSecurityContext()); assertFalse(req.hasTrailingSlash()); assertEquals("resource", req.getPath()); assertEquals("foo", req.getExt()); assertEquals(RdfMediaType.TEXT_TURTLE, req.getContentType()); }
public TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers) { this(request, uriInfo, headers, null); }
TrellisRequest { public TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers) { this(request, uriInfo, headers, null); } }
TrellisRequest { public TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers) { this(request, uriInfo, headers, null); } TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers);  TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers,
            final SecurityContext secCtx); }
TrellisRequest { public TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers) { this(request, uriInfo, headers, null); } TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers);  TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers,
            final SecurityContext secCtx); String getContentType(); String getSlug(); Link getLink(); AcceptDatetime getDatetime(); Prefer getPrefer(); Range getRange(); String getPath(); boolean hasTrailingSlash(); Version getVersion(); String getExt(); String getBaseUrl(); SecurityContext getSecurityContext(); String getMethod(); MultivaluedMap<String, String> getHeaders(); List<MediaType> getAcceptableMediaTypes(); static String buildBaseUrl(final URI uri, final MultivaluedMap<String, String> headers); }
TrellisRequest { public TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers) { this(request, uriInfo, headers, null); } TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers);  TrellisRequest(final Request request, final UriInfo uriInfo, final HttpHeaders headers,
            final SecurityContext secCtx); String getContentType(); String getSlug(); Link getLink(); AcceptDatetime getDatetime(); Prefer getPrefer(); Range getRange(); String getPath(); boolean hasTrailingSlash(); Version getVersion(); String getExt(); String getBaseUrl(); SecurityContext getSecurityContext(); String getMethod(); MultivaluedMap<String, String> getHeaders(); List<MediaType> getAcceptableMediaTypes(); static String buildBaseUrl(final URI uri, final MultivaluedMap<String, String> headers);  }