Gerald Nguyen
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

--

--

Gerald Nguyen
Gerald Nguyen

Written by Gerald Nguyen

Engineering Lead. I write about software development, and sometimes writing itself. Mostly original. https://bit.ly/geraldnguyen

No responses yet