Examples of toURIString()


Examples of org.springframework.web.util.UriComponents.toUriString()

  }

  @Test
  public void testFromControllerNotMapped() {
    UriComponents uriComponents = fromController(UnmappedController.class).build();
    assertThat(uriComponents.toUriString(), is("http://localhost/"));
  }

  @Test
  public void testFromMethodNamePathVariable() throws Exception {
    UriComponents uriComponents = fromMethodName(
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  @Test
  public void testFromMethodNamePathVariable() throws Exception {
    UriComponents uriComponents = fromMethodName(
        ControllerWithMethods.class, "methodWithPathVariable", new Object[]{"1"}).build();

    assertThat(uriComponents.toUriString(), is("http://localhost/something/1/foo"));
  }

  @Test
  public void testFromMethodNameTypeLevelPathVariable() throws Exception {
    this.request.setContextPath("/myapp");
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  public void testFromMethodNameTypeLevelPathVariable() throws Exception {
    this.request.setContextPath("/myapp");
    UriComponents uriComponents = fromMethodName(
        PersonsAddressesController.class, "getAddressesForCountry", "DE").buildAndExpand("1");

    assertThat(uriComponents.toUriString(), is("http://localhost/myapp/people/1/addresses/DE"));
  }

  @Test
  public void testFromMethodNameTwoPathVariables() throws Exception {
    DateTime now = DateTime.now();
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  @Test
  public void testFromMethodNameNotMapped() throws Exception {
    UriComponents uriComponents = fromMethodName(UnmappedController.class, "unmappedMethod").build();

    assertThat(uriComponents.toUriString(), is("http://localhost/"));
  }

  @Test
  public void testFromMethodCall() {
    UriComponents uriComponents = fromMethodCall(on(ControllerWithMethods.class).myMethod(null)).build();
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  @Test
  public void testFromMethodCall() {
    UriComponents uriComponents = fromMethodCall(on(ControllerWithMethods.class).myMethod(null)).build();

    assertThat(uriComponents.toUriString(), startsWith("http://localhost"));
    assertThat(uriComponents.toUriString(), endsWith("/something/else"));
  }

  @Test
  public void testFromMethodCallWithTypeLevelUriVars() {
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  @Test
  public void testFromMethodCall() {
    UriComponents uriComponents = fromMethodCall(on(ControllerWithMethods.class).myMethod(null)).build();

    assertThat(uriComponents.toUriString(), startsWith("http://localhost"));
    assertThat(uriComponents.toUriString(), endsWith("/something/else"));
  }

  @Test
  public void testFromMethodCallWithTypeLevelUriVars() {
    UriComponents uriComponents = fromMethodCall(on(
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  @Test
  public void testFromMethodCallWithTypeLevelUriVars() {
    UriComponents uriComponents = fromMethodCall(on(
        PersonsAddressesController.class).getAddressesForCountry("DE")).buildAndExpand(15);

    assertThat(uriComponents.toUriString(), endsWith("/people/15/addresses/DE"));
  }


  @Test
  public void testFromMethodCallWithPathVar() {
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  @Test
  public void testFromMethodCallWithPathVar() {
    UriComponents uriComponents = fromMethodCall(on(
        ControllerWithMethods.class).methodWithPathVariable("1")).build();

    assertThat(uriComponents.toUriString(), startsWith("http://localhost"));
    assertThat(uriComponents.toUriString(), endsWith("/something/1/foo"));
  }

  @Test
  public void testFromMethodCallWithPathVarAndRequestParams() {
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  public void testFromMethodCallWithPathVar() {
    UriComponents uriComponents = fromMethodCall(on(
        ControllerWithMethods.class).methodWithPathVariable("1")).build();

    assertThat(uriComponents.toUriString(), startsWith("http://localhost"));
    assertThat(uriComponents.toUriString(), endsWith("/something/1/foo"));
  }

  @Test
  public void testFromMethodCallWithPathVarAndRequestParams() {
    UriComponents uriComponents = fromMethodCall(on(
View Full Code Here

Examples of org.springframework.web.util.UriComponents.toUriString()

  @Test
  public void usesForwardedHostAsHostIfHeaderIsSet() {
    this.request.addHeader("X-Forwarded-Host", "somethingDifferent");
    UriComponents uriComponents = fromController(PersonControllerImpl.class).build();

    assertThat(uriComponents.toUriString(), startsWith("http://somethingDifferent"));
  }

  @Test
  public void usesForwardedHostAndPortFromHeader() {
    request.addHeader("X-Forwarded-Host", "foobar:8088");
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.