Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: test-framework
    • Labels:
      None

      Description

      When using the InMemoryTestContainer, unless the client request has an entity, the client request headers are omitted when the connector creates the ContainerRequest for the in-memory container.

      More details:

      The problematic method is "public ClientResponse apply(final ClientRequest clientRequest)" in class InMemoryConnector. In the current implementation, client request headers are copied to the ContainerRequest by a StreamProvider which is set on the original ClientRequest, inside an "if" block, before coping the entity to the ContainerRequest (line 199)

        Activity

        Hide
        Jakub Podlesak added a comment -

        There is an existing test case in Jersey workspace (see InMemoryContainerTest) for this that uses GET method.
        Tried to reproduce for HTTP POST in addition, but to no avail. Please provide some more details on how to reproduce
        the bug, so that i can re-open this report.

        Show
        Jakub Podlesak added a comment - There is an existing test case in Jersey workspace (see InMemoryContainerTest) for this that uses GET method. Tried to reproduce for HTTP POST in addition, but to no avail. Please provide some more details on how to reproduce the bug, so that i can re-open this report.
        Hide
        shai.nagar added a comment -

        The bug has been fixed in Jersey 2.3. I reproduced it on 2.2 simply by setting headers on an HTTP GET request, send the request to the in-memory container and trying to get them in my resource class, no other tricks. Anyway, as I mentioned, after upgrading my project to Jersey 2.3 the problem was gone. When I looked at the same method I specified in the description, I clearly saw the fix I expected.

        Show
        shai.nagar added a comment - The bug has been fixed in Jersey 2.3. I reproduced it on 2.2 simply by setting headers on an HTTP GET request, send the request to the in-memory container and trying to get them in my resource class, no other tricks. Anyway, as I mentioned, after upgrading my project to Jersey 2.3 the problem was gone. When I looked at the same method I specified in the description, I clearly saw the fix I expected.

          People

          • Assignee:
            Jakub Podlesak
            Reporter:
            shai.nagar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: