eclipse-ee4j / eclipse-ee4j/jersey

InboundJaxrsResponse not Equal to OutboundJaxrsResponse

Open
#3,694 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

I am trying to test one of my Resource methods but it seems not to work. This is what I've tried so far.
I logged the Response being returned with this code
`log.info("I am the response: " + Response.status(Response.Status.CREATED).entity(inserted).build());`
and it showed
`I am the response: OutboundJaxrsResponse{status=201, reason=Created, hasEntity=true, closed=false, buffered=false}`
but in the test method, I used this code to get the response from the method
`response = target.request(MediaType.APPLICATION_JSON).post(Entity.entity(l, MediaType.APPLICATION_JSON));` .
I also logged this Response with this code `log.info("The available response is: " + target.request(MediaType.APPLICATION_JSON).post(Entity.entity(l, MediaType.APPLICATION_JSON)));`
and I got the response as `The available response is: InboundJaxrsResponse{context=ClientResponse{method=POST, uri=http://localhost:32774/v1/ledgers/by-id/OLDR9750JGGB5T2L4P6TC36ND, status=200, reason=OK}}`

Please help

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.