#1696 - Re-instantiate conversion for request parameter template variables.
When adding a request parameter template variable and the URI part of the template already contains a request parameter we now automatically turn the variable type into request parameter continuation. That apparently got lost in the move to level 4 URI templates in #1583.
This commit is contained in:
@@ -366,6 +366,15 @@ class UriTemplateUnitTest {
|
||||
assertThat(uri).isEqualTo(URI.create("/foo/first/second"));
|
||||
}
|
||||
|
||||
@Test // #1696
|
||||
void adaptsRequestParamVariableToContinuationIfBaseUriContainsParameter() {
|
||||
|
||||
UriTemplate template = UriTemplate.of("/path/{bar}/foo.zip?type=foo")
|
||||
.with(new TemplateVariable("foobar", VariableType.REQUEST_PARAM));
|
||||
|
||||
assertThat(template.toString()).isEqualTo("/path/{bar}/foo.zip?type=foo{&foobar}");
|
||||
}
|
||||
|
||||
private static void assertVariables(UriTemplate template, TemplateVariable... variables) {
|
||||
assertVariables(template, Arrays.asList(variables));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user