Jul 20, 2023
The solution is the same whether you have the Mono.defer in a bean or, in my sample, a unit test.
Autowiring or injecting a shared WebClient into your bean is the essentially the same as declaring the `var webClient` in my sample code.
Your bean can then do whatever it wants with the webclient, including wrapping its call within a Mono.defer