Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce andPerformRequest() method in ResponseActions #28987

Closed
wants to merge 1 commit into from

Conversation

edyda99
Copy link
Contributor

@edyda99 edyda99 commented Aug 21, 2022

Prior to this commit it wasn't possible to achieve real
client-side Rest using a restTemplate that was bound by MockRestServiceServer

This commit introduces andPerformRequest() method in
which it supplies responseCreator with a real Rest call provided by copying the clientHttpRequest and performing a http call using the default ClientHttpRequest used by restTemplate: SimpleClientHttpRequestFactory

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 21, 2022
Prior to this commit it wasn't possible to achieve real
client-side Rest using a restTemplate that was bound by MockRestServiceServer

This commit introduces andPerformRequest() method in
which it supplies responseCreator with a real Rest call provided by copying the clientHttpRequest and performing a http call using the default ClientHttpRequest used by restTemplate: SimpleClientHttpRequestFactory
@edyda99
Copy link
Contributor Author

edyda99 commented Aug 22, 2022

For testing, I used to assert that the exception contains "Connection refused: connect" but the pipeline was failing,
I guess because the port is opened, it's returning connection timeout instead of connection refused.
When someone reviews, I need some suggestions on the best way to add unit tests to this feature.

@rstoyanchev rstoyanchev added in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 24, 2023
@rstoyanchev
Copy link
Contributor

Apologies for not noticing this sooner, but this is a duplicate of #26381 and was done, slightly differently, in #29721. Thanks for the pull request in any case!

@rstoyanchev rstoyanchev added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 27, 2023
@edyda99
Copy link
Contributor Author

edyda99 commented Feb 14, 2023

Sorry to hear that, Can you suggest any ticket for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module in: web Issues in web modules (web, webmvc, webflux, websocket) status: duplicate A duplicate of another issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants