title: Which is the best way to do end to end testing of Spring Boot Rest APIs?
body: <p>I have checked in google and stackoverflow for end to end testing of Spring Boot Rest APIs.</p>
  
  <p>I would like to test  controller -> Service -> Repository at once.</p>
  
  <p>I found two approaches are efficient:</p>
  
  <pre><code>1. TestRestTemplate: 
     Single call to the controller method with in-memory database configuration for repository.
  2. MockMvc: 
     Create 2 Test classes. 
     one for Controller-&gt;Service 
     and one for Service-&gt;Repository. 
     Is there any way to club both 2 classes into one class.
  </code></pre>
  
  <p>which is the best way to do "end to end testing" of Spring Boot Rest APIs from above 2 approaches ???</p>