@Test public void testFromRepositoryURI() { setUpExpectations(); URI collectionURI = URI.create("http: List<JsonApiIdentifiable> entities = new ArrayList<>(); for (int i = 0; i < NR_ENTITIES; i++) { entities.add(createCustomMinimalEntity(String.valueOf(i))); } Response result = JsonApiResponse .createGetResponse(uriInfo) .data(entities) .fromRepositoryURI(collectionURI) .build(); assertIsValidJsonApiDataResponse(result); JsonNode resultNode = extractJsonEntity(result); assertIsValidDataNode(resultNode.get("data")); for (int i = 0; i < NR_ENTITIES; i++) { JsonNode links = resultNode.get("data").get(i).get("links"); Assert.assertEquals(1, links.size()); Assert.assertEquals(collectionURI.toString() + "/" + i, links.get("self").textValue()); } }
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; }