Examples of MethodParameter


Examples of org.springframework.core.MethodParameter

   */
  @Test
  public void createsPlainAssemblerWithoutContext() throws Exception {

    Method method = Controller.class.getMethod("noContext", PagedResourcesAssembler.class);
    Object result = resolver.resolveArgument(new MethodParameter(method, 0), null, null, null);

    assertThat(result, is(instanceOf(PagedResourcesAssembler.class)));
    assertThat(result, is(not(instanceOf(MethodParameterAwarePagedResourcesAssembler.class))));
  }
View Full Code Here

Examples of org.springframework.core.MethodParameter

   */
  @Test
  public void doesNotFailForTemplatedMethodMapping() throws Exception {

    Method method = Controller.class.getMethod("methodWithPathVariable", PagedResourcesAssembler.class);
    Object result = resolver.resolveArgument(new MethodParameter(method, 0), null, null, null);

    assertThat(result, is(notNullValue()));
  }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    Method method = Controller.class.getMethod("methodWithMapping", PagedResourcesAssembler.class);

    // Simulate HandlerMethod.HandlerMethodParameter.getDeclaringClass()
    // as it's returning the invoked class as the declared one
    MethodParameter methodParameter = new MethodParameter(method, 0) {
      public java.lang.Class<?> getDeclaringClass() {
        return SubController.class;
      }
    };
View Full Code Here

Examples of org.springframework.core.MethodParameter

    assertThat(uriComponents.getPath(), is("/foo/mapping"));
  }

  private void assertSelectsParameter(Method method, int expectedIndex) throws Exception {

    MethodParameter parameter = new MethodParameter(method, 0);

    Object result = resolver.resolveArgument(parameter, null, null, null);
    assertMethodParameterAwarePagedResourcesAssemblerFor(result, new MethodParameter(method, expectedIndex));
  }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    Method method = Controller.class.getMethod(methodName, PagedResourcesAssembler.class, Pageable.class,
        Pageable.class);

    exception.expect(IllegalStateException.class);
    resolver.resolveArgument(new MethodParameter(method, 0), null, null, null);
  }
View Full Code Here

Examples of org.springframework.core.MethodParameter

  }

  private void assertUriStringFor(Sort sort, String expected, String baseUri) throws Exception {

    UriComponentsBuilder builder = UriComponentsBuilder.fromUri(new URI(baseUri));
    MethodParameter parameter = getParameterOfMethod("supportedMethod");

    new HateoasSortHandlerMethodArgumentResolver().enhance(builder, parameter, sort);

    assertThat(builder.build().toUriString(), endsWith(expected));
  }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    private MethodParameter soapHeaderParameter;

    @Before
    public void setUp() throws Exception {
        resolver = new SoapMethodArgumentResolver();
        soapMessageParameter = new MethodParameter(getClass().getMethod("soapMessage", SoapMessage.class), 0);
        soapEnvelopeParameter = new MethodParameter(getClass().getMethod("soapEnvelope", SoapEnvelope.class), 0);
        soapBodyParameter = new MethodParameter(getClass().getMethod("soapBody", SoapBody.class), 0);
        soapHeaderParameter = new MethodParameter(getClass().getMethod("soapHeader", SoapHeader.class), 0);
    }
View Full Code Here

Examples of org.springframework.core.MethodParameter

        for (int i = 0; i < 3; i++) {
            SoapHeaderElement element = message.getSoapHeader().addHeaderElement(HEADER_QNAME);
            element.setText(HEADER_CONTENT + i);
        }
        soapHeaderWithEmptyValue =
                new MethodParameter(getClass().getMethod("soapHeaderWithEmptyValue", SoapHeaderElement.class), 0);
        soapHeaderElementParameter =
                new MethodParameter(getClass().getMethod("soapHeaderElement", SoapHeaderElement.class), 0);
        soapHeaderElementListParameter =
                new MethodParameter(getClass().getMethod("soapHeaderElementList", List.class), 0);
        soapHeaderMismatch =
                new MethodParameter(getClass().getMethod("soapHeaderMismatch", SoapHeaderElement.class), 0);
        soapHeaderMismatchList = new MethodParameter(getClass().getMethod("soapHeaderMismatchList", List.class), 0);
    }
View Full Code Here

Examples of org.springframework.core.MethodParameter

    }

    @Override
    protected MethodParameter[] createSupportedParameters() throws NoSuchMethodException {
        return new MethodParameter[]{
                new MethodParameter(getClass().getMethod("element", Element.class), 0)};
    }
View Full Code Here

Examples of org.springframework.core.MethodParameter

                new MethodParameter(getClass().getMethod("element", Element.class), 0)};
    }

    @Override
    protected MethodParameter[] createSupportedReturnTypes() throws NoSuchMethodException {
        return new MethodParameter[]{new MethodParameter(getClass().getMethod("element", Element.class), -1)};
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.