Examples of indexToName()


Examples of feign.MethodMetadata.indexToName()

  @Test public void pathParamsParseIntoIndexToName() throws Exception {
    MethodMetadata md = contract.parseAndValidatateMetadata(WithURIParam.class.getDeclaredMethod("uriParam", String.class,
        URI.class, String.class));
    assertEquals(md.template().url(), "/{1}/{2}");
    assertEquals(md.indexToName().get(0), ImmutableSet.of("1"));
    assertEquals(md.indexToName().get(2), ImmutableSet.of("2"));
  }

  interface WithPathAndQueryParams {
    @GET @Path("/domains/{domainId}/records")
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

  @Test public void pathParamsParseIntoIndexToName() throws Exception {
    MethodMetadata md = contract.parseAndValidatateMetadata(WithURIParam.class.getDeclaredMethod("uriParam", String.class,
        URI.class, String.class));
    assertEquals(md.template().url(), "/{1}/{2}");
    assertEquals(md.indexToName().get(0), ImmutableSet.of("1"));
    assertEquals(md.indexToName().get(2), ImmutableSet.of("2"));
  }

  interface WithPathAndQueryParams {
    @GET @Path("/domains/{domainId}/records")
    Response recordsByNameAndType(@PathParam("domainId") int id, @QueryParam("name") String nameFilter,
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

    assertNull(md.template().bodyTemplate());
    assertTrue(md.template().headers().isEmpty());
    assertEquals(md.template().url(), "/domains/{domainId}/records");
    assertEquals(md.template().queries().get("name"), ImmutableSet.of("{name}"));
    assertEquals(md.template().queries().get("type"), ImmutableSet.of("{type}"));
    assertEquals(md.indexToName().get(0), ImmutableSet.of("domainId"));
    assertEquals(md.indexToName().get(1), ImmutableSet.of("name"));
    assertEquals(md.indexToName().get(2), ImmutableSet.of("type"));
    assertEquals(md.template().toString(), "GET /domains/{domainId}/records?name={name}&type={type} HTTP/1.1\n");
  }
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

    assertTrue(md.template().headers().isEmpty());
    assertEquals(md.template().url(), "/domains/{domainId}/records");
    assertEquals(md.template().queries().get("name"), ImmutableSet.of("{name}"));
    assertEquals(md.template().queries().get("type"), ImmutableSet.of("{type}"));
    assertEquals(md.indexToName().get(0), ImmutableSet.of("domainId"));
    assertEquals(md.indexToName().get(1), ImmutableSet.of("name"));
    assertEquals(md.indexToName().get(2), ImmutableSet.of("type"));
    assertEquals(md.template().toString(), "GET /domains/{domainId}/records?name={name}&type={type} HTTP/1.1\n");
  }

  @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "QueryParam.value\\(\\) was empty on parameter 0")
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

    assertEquals(md.template().url(), "/domains/{domainId}/records");
    assertEquals(md.template().queries().get("name"), ImmutableSet.of("{name}"));
    assertEquals(md.template().queries().get("type"), ImmutableSet.of("{type}"));
    assertEquals(md.indexToName().get(0), ImmutableSet.of("domainId"));
    assertEquals(md.indexToName().get(1), ImmutableSet.of("name"));
    assertEquals(md.indexToName().get(2), ImmutableSet.of("type"));
    assertEquals(md.template().toString(), "GET /domains/{domainId}/records?name={name}&type={type} HTTP/1.1\n");
  }

  @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "QueryParam.value\\(\\) was empty on parameter 0")
  public void emptyQueryParam() throws Exception {
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

        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"));
  }

  @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "FormParam.value\\(\\) was empty on parameter 0")
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

    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"));
  }

  @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "FormParam.value\\(\\) was empty on parameter 0")
  public void emptyFormParam() throws Exception {
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

    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"));
  }

  @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "FormParam.value\\(\\) was empty on parameter 0")
  public void emptyFormParam() throws Exception {
    contract.parseAndValidatateMetadata(FormParams.class.getDeclaredMethod("emptyFormParam", String.class));
View Full Code Here

Examples of feign.MethodMetadata.indexToName()

  @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"));
  }

  @Test(expectedExceptions = IllegalStateException.class, expectedExceptionsMessageRegExp = "HeaderParam.value\\(\\) was empty on parameter 0")
  public void emptyHeaderParam() throws Exception {
    contract.parseAndValidatateMetadata(HeaderParams.class.getDeclaredMethod("emptyHeaderParam", String.class));
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.