Package feign

Examples of feign.MethodMetadata


    @GET Response emptyFormParam(@FormParam("") String empty);
  }

  @Test public void formParamsParseIntoIndexToName() throws Exception {
    MethodMetadata md = contract.parseAndValidatateMetadata(FormParams.class.getDeclaredMethod("login", String.class,
        String.class, String.class));

    assertNull(md.template().body());
    assertNull(md.template().bodyTemplate());
    assertEquals(md.formParams(), ImmutableList.of("customer_name", "user_name", "password"));
    assertEquals(md.indexToName().get(0), ImmutableSet.of("customer_name"));
    assertEquals(md.indexToName().get(1), ImmutableSet.of("user_name"));
    assertEquals(md.indexToName().get(2), ImmutableSet.of("password"));
  }
View Full Code Here


    @GET Response emptyHeaderParam(@HeaderParam("") String empty);
  }

  @Test public void headerParamsParseIntoIndexToName() throws Exception {
    MethodMetadata md = contract.parseAndValidatateMetadata(HeaderParams.class.getDeclaredMethod("logout", String.class));

    assertEquals(md.template().headers().get("Auth-Token"), ImmutableSet.of("{Auth-Token}"));
    assertEquals(md.indexToName().get(0), ImmutableSet.of("Auth-Token"));
  }
View Full Code Here

  interface PathsWithoutAnySlashes {
    @GET @Path("specific") Response get();
  }

  @Test public void pathsWithoutSlashesParseCorrectly() throws Exception {
    MethodMetadata md = contract.parseAndValidatateMetadata(PathsWithoutAnySlashes.class.getDeclaredMethod("get"));
    assertEquals(md.template().url(), "/base/specific");
  }
View Full Code Here

  interface PathsWithSomeSlashes {
    @GET @Path("specific") Response get();
  }

  @Test public void pathsWithSomeSlashesParseCorrectly() throws Exception {
    MethodMetadata md = contract.parseAndValidatateMetadata(PathsWithSomeSlashes.class.getDeclaredMethod("get"));
    assertEquals(md.template().url(), "/base/specific");
  }
View Full Code Here

  interface PathsWithSomeOtherSlashes {
    @GET @Path("/specific") Response get();
  }

  @Test public void pathsWithSomeOtherSlashesParseCorrectly() throws Exception {
    MethodMetadata md = contract.parseAndValidatateMetadata(PathsWithSomeOtherSlashes.class.getDeclaredMethod("get"));
    assertEquals(md.template().url(), "/base/specific");
  }
View Full Code Here

TOP

Related Classes of feign.MethodMetadata

Copyright © 2018 www.massapicom. 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.