title: Isolated Controller Test can't instantiate Pageable
body: <p>I have a Spring MVC Controller which uses Pagination Support of Spring-Data:</p>
  
  <pre><code>@Controller
  public class ModelController {
  
      private static final int DEFAULT_PAGE_SIZE = 50;
  
      @RequestMapping(value = "/models", method = RequestMethod.GET)
      public Page&lt;Model&gt; showModels(@PageableDefault(size = DEFAULT_PAGE_SIZE) Pageable pageable, @RequestParam(
              required = false) String modelKey) {
  
  //..
          return models;
      }
  
  }
  </code></pre>
  
  <p>And I'd like to test the RequestMapping using the nice Spring MVC Test Support. In order to keep these tests fast and isolated from all the other stuff going on, I do not want to create the complete ApplicationContext:</p>
  
  <pre><code>public class ModelControllerWebTest {
      private MockMvc mockMvc;
  
      @Before
      public void setup() {
          ModelController controller = new ModelController();
          mockMvc = MockMvcBuilders.standaloneSetup(controller).build();
      }
  
      @Test
      public void reactsOnGetRequest() throws Exception {
          mockMvc.perform(get("/models")).andExpect(status().isOk());
      }
  
  }
  </code></pre>
  
  <p>This approach works fine with other Controllers, that do not expect a Pageable, but with this one I get one of these nice long Spring stacktraces. It complains about not being able to instantiate Pageable:</p>
  
  <pre><code>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.data.domain.Pageable]: Specified class is an interface
  at   
  .... lots more lines
  </code></pre>
  
  <p>Question: How do I change my test so the magic No-Request-Parameter-To-Pageable conversion happens properly?</p>
  
  <p>Note: In the actual application everything is working fine.</p>