title: How do I set up unit tests for RepositoryRestController in Spring?
body: <p>I have the following configuration for my unit test for a <code>RepositoryRestController</code> (the <code>MyController</code> class):</p>
  
  <pre><code>@RunWith(SpringRunner.class)
  @WebMvcTest
  public class MyTest {
  
      @Configuration
      @EnableSpringDataWebSupport
      static class TestConfiguration {
  
          @Bean
          MyController myController() {
              //controller construction
          }
      }
  
  }
  </code></pre>
  
  <p>I can't find any documents online expounding on what sort of config I need to setup to get the tests running correctly. I only stumbled upon <code>EnableSpringDataWebSupport</code> when I was having trouble injecting <code>Pageable</code> instance on the controller method I'm testing. Now, my problem is that <code>PersistentEntityResourceAssembler</code> doesn't get autowired because the log says it has no default constructor. How does Spring setup this up?</p>
  
  <p>As for the duplication with <a href="https://stackoverflow.com/questions/46658333">this question</a>, notice that my configuration is not all that much different from the accepted answer and I'm still having problems. <code>@WebMvcTest</code> implies <code>@AutoConfigureMockMvc</code>. I've exhausted most of the information I could search about this problem before posting this question.</p>