@Test public void testGetResponseRestrictTo() { setUpExpectations(); JsonApiIdentifiable entity = createEntityWithAttributes(); Response result = JsonApiResponse .createGetResponse(uriInfo) .data(entity) .restrictTo("intAttribute") .build(); assertIsValidJsonApiDataResponse(result); JsonNode resultJson = extractJsonEntity(result).get("data"); Assert.assertEquals(3, resultJson.size()); Assert.assertTrue(resultJson.has("attributes")); Assert.assertEquals(1, resultJson.get("attributes").size()); Assert.assertEquals(1, resultJson.get("attributes").get("intAttribute").asInt()); }
public static RequiredEntity createGetResponse(UriInfo uriInfo) { Assert.assertNotNull(uriInfo); return new Builder(new JsonApiResponse(uriInfo, Response.Status.OK)); }
JsonApiResponse { public static RequiredEntity createGetResponse(UriInfo uriInfo) { Assert.assertNotNull(uriInfo); return new Builder(new JsonApiResponse(uriInfo, Response.Status.OK)); } }
JsonApiResponse { public static RequiredEntity createGetResponse(UriInfo uriInfo) { Assert.assertNotNull(uriInfo); return new Builder(new JsonApiResponse(uriInfo, Response.Status.OK)); } private  JsonApiResponse(UriInfo uriInfo, Response.StatusType statusCode); private  JsonApiResponse(Response.StatusType statusCode); }
JsonApiResponse { public static RequiredEntity createGetResponse(UriInfo uriInfo) { Assert.assertNotNull(uriInfo); return new Builder(new JsonApiResponse(uriInfo, Response.Status.OK)); } private  JsonApiResponse(UriInfo uriInfo, Response.StatusType statusCode); private  JsonApiResponse(Response.StatusType statusCode); static RequiredEntity createGetResponse(UriInfo uriInfo); static RequiredEntity createPostResponse(UriInfo uriInfo); static RequiredEntity createPutResponse(UriInfo uriInfo); static BuildableException createExceptionResponse(Response.Status code); }
JsonApiResponse { public static RequiredEntity createGetResponse(UriInfo uriInfo) { Assert.assertNotNull(uriInfo); return new Builder(new JsonApiResponse(uriInfo, Response.Status.OK)); } private  JsonApiResponse(UriInfo uriInfo, Response.StatusType statusCode); private  JsonApiResponse(Response.StatusType statusCode); static RequiredEntity createGetResponse(UriInfo uriInfo); static RequiredEntity createPostResponse(UriInfo uriInfo); static RequiredEntity createPutResponse(UriInfo uriInfo); static BuildableException createExceptionResponse(Response.Status code); static final String JSONAPI_TYPE; }