protected void assertSupportedAndResult(
      MethodParameter parameter, Pageable pageable, NativeWebRequest request) throws Exception {

    HandlerMethodArgumentResolver resolver = getResolver();
    assertThat(resolver.supportsParameter(parameter), is(true));
    assertThat(resolver.resolveArgument(parameter, null, request, null), is((Object) pageable));
  }
  @Test
  public void rejectsNoQualifiers() throws Exception {

    MethodParameter parameter =
        TestUtils.getParameterOfMethod(
            getControllerClass(), "noQualifiers", Pageable.class, Pageable.class);

    HandlerMethodArgumentResolver resolver = getResolver();
    assertThat(resolver.supportsParameter(parameter), is(true));

    exception.expect(IllegalStateException.class);
    exception.expectMessage("Ambiguous");

    resolver.resolveArgument(parameter, null, TestUtils.getWebRequest(), null);
  }