Skip to content

Curious about pruning of context-path in contract and in consumer-side test #2306

@davidmichaelkarr

Description

@davidmichaelkarr

My POC is basically working, both for provider-side and consumer-side tests. One thing that I found curious was what is done with the endpoint url with respect to the context-path.

In the contract definition, the url value must not include the context-path apparently. Taken by itself, this is not that surprising, but the apparent effect on the consumer-side test is more surprising.

The resource controller has an autowired url for the endpoint it has to reach, which will include the port number. In my consumer-side test, I have to munge that with reflection, changing the port to the stub runner port. This is not surprising. What is surprising is that I also have to change that url to remove the context-path. The context-path in our services is always "/msapi", so now instead of the url being something like http://localhost:8080/msapi/servicename/endpoint, it becomes http://localhost:<stubrunnerport>/servicename/endpoint. This works, but it sure seems odd.

Can you explain the background of this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions