You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
Curious about pruning of context-path in contract and in consumer-side test #2306
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.
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 becomeshttp://localhost:<stubrunnerport>/servicename/endpoint. This works, but it sure seems odd.Can you explain the background of this?