title: Correct dependencies to use when using WebClient with Spring MVC
body: <p>I'm using Spring MVC to develop some controllers.</p>
  <p>I would like to write some scenario integration tests which will involve calling multiple controllers of my application.</p>
  <p>Normally I would have just used <a href="https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html" rel="nofollow noreferrer">RestTemplate</a> within these tests but the documentation states:</p>
  <blockquote>
  <p>Please, consider using the org.springframework.web.reactive.client.WebClient which has a more modern API and supports sync, async, and streaming scenarios.</p>
  </blockquote>
  <p>And so I would like to write future-proof code by using the WebClient. But I have a number of questions:</p>
  <ol>
  <li>What dependencies should be included here?</li>
  </ol>
  <pre><code> // (1) For Spring MVC:
   'org.springframework.boot:spring-boot-starter-web:2.4.1'
   // (2) For spring webflux
   'org.springframework.boot:spring-boot-starter-webflux:2.4.1'
  </code></pre>
  <p>The problem is am I not including too much by having both (1) and (2)? Is there a separate dependency which I should include specifically just to get access to the WebClient? Or is it best practice to include both of these?</p>
  <ol start="2">
  <li>Should I write the tests using the WebClient or TestWebClient?</li>
  </ol>
  <p>Given that I just want to make HTTP requests to my server in the integration tests I write - I think using the WebClient is fine? Or is it preferred to use the TestWebClient within these sort of tests? What is best practice?</p>