JsonApiResponse { public static RequiredEntity createPostResponse(UriInfo uriInfo) { Assert.assertNotNull(uriInfo); return new Builder(new JsonApiResponse(uriInfo, Response.Status.CREATED)); } 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; }
@Test public void testPostResponse() { setUpExpectations(); JsonApiIdentifiable testEntity = createEntityWithAttributes(); Response result = JsonApiResponse .createPostResponse(uriInfo) .data(testEntity) .build(); Assert.assertEquals(201, result.getStatus()); assertIsValidJsonApiDataResponse(result); assertHasValidData(extractJsonEntity(result)); }