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
Ensure the WebClient to be present before enabling the WebTestClientContextCustomizer #24152
Conversation
Please leave a note if you'd like to have a test case for the change. |
Thanks very much for the pull request, @gesellix. A test for this would be great if you have the time. It should be possible to test it using |
eb9ee3f
to
4c60562
Compare
@wilkinsona thanks for the hints about |
@@ -0,0 +1,55 @@ | |||
/* | |||
* Copyright 2012-2019 the original author or authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, if there's a policy about changing the copyright notice to ...-2020
, but I guess that could be adjusted for the whole code base :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We change the date whenever the file is updated. This should be 2020 but don't worry we'll take care of that when merging.
This commit reinstanties the isWeBClientPresent() check so that WebTestClientContextCustomizer is only added if a web client is available. See gh-24152
@gesellix thank you for the report and the PR. |
You're welcome, thanks for merging! :) |
Our
@SpringBootTest
in aSERVLET
SpringApplication fails with the stacktrace below after an upgrade from Spring-Boot 2.3.6 to 2.4.0.It seems like a check on the presence of
WebClient
had been removed with the refactoring at 6b437ec#diff-0468685a60929025a2cf3fe3ed6a01021f7b6865d562536897e5915c3a483c40L42.This pull request adds the check for
isWebClientPresent()
.stacktrace