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
The user guide has a whole section on TestRestTemplate which is great. It doesn't help for a vanilla @SpringBootTest though because the default WebEnvironment is MOCK (I think). My understanding was that WebTestClient was usable wherever MockMvc would have been (i.e the default test environment). But you can't @Autowired one by default.
You have to explicitly @AutoConfigureWebTestClient. There is actually a side bar note about that, but it's quite hard to find, since it is in the section on @WebFluxTest, which I wasn't using.