Skip to content

Use of ExpectationForwardAndResponseCallback with forward. #1927

@max-m-s

Description

@max-m-s

(This might a documentation issue rather than a bug)

I'm trying to run a mockserver as a proxy that handles JOSE then fowards the clear payload, then encrypts the response. But I don't understand how to define both a foward (the destination) and a callback at the same time, as this appears to be invalid:

{ "id": "1", "httpRequest": { "path": "" }, "httpForward": { "host": "127.0.0.1", "port": 6082, "scheme": "HTTP" }, "httpForwardClassCallback": {"callbackClass": "my.package.MyCallback"} }

Since you can only define a "httpForward" or a "httpForwardClassCallback" but not both. If I only define "httpForwardClassCallback" how do I tell it where to go? Is there something to set in the HttpRequest object during the callback?

The example using the ExpectationForwardAndResponseCallback class doesn't explain this either, or ExpectationForwardCallback for that matter.

I've also tried adding two Expectations, but only the first one added is invoked.

Does anyone have any examples of how to use these?

MockServer Version: 5.13.1 (latest shaded version available on corporate repo). I cannot access the public Maven.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions