Search in sources :

Example 1 with UriComponentsBuilder.fromUriString

use of org.springframework.web.util.UriComponentsBuilder.fromUriString in project spring-framework by spring-projects.

the class UriComponentsTests method expandWithRegexVar.

// SPR-13311
@Test
public void expandWithRegexVar() {
    String template = "/myurl/{name:[a-z]{1,5}}/show";
    UriComponents uriComponents = UriComponentsBuilder.fromUriString(template).build();
    uriComponents = uriComponents.expand(Collections.singletonMap("name", "test"));
    assertEquals("/myurl/test/show", uriComponents.getPath());
}
Also used : UriComponentsBuilder.fromUriString(org.springframework.web.util.UriComponentsBuilder.fromUriString) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 UriComponentsBuilder.fromUriString (org.springframework.web.util.UriComponentsBuilder.fromUriString)1