Skip to content

Commit c13cab0

Browse files
committed
#1683 - Backport of tests.
Backport of the tests introduced with 071256 to make sure the problem doesn't exist in this branch.
1 parent 912dce9 commit c13cab0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/org/springframework/hateoas/UriTemplateUnitTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,15 @@ void variableParameterIsTemplated() {
348348
assertThat(UriTemplate.isTemplate("http://localhost/api/rest/v1/userGroups/50/functions/{?id*}")).isTrue();
349349
}
350350

351+
@Test // #1696
352+
void adaptsRequestParamVariableToContinuationIfBaseUriContainsParameter() {
353+
354+
UriTemplate template = UriTemplate.of("/path/{bar}/foo.zip?type=foo")
355+
.with(new TemplateVariable("foobar", VariableType.REQUEST_PARAM));
356+
357+
assertThat(template.toString()).isEqualTo("/path/{bar}/foo.zip?type=foo{&foobar}");
358+
}
359+
351360
private static void assertVariables(UriTemplate template, TemplateVariable... variables) {
352361
assertVariables(template, Arrays.asList(variables));
353362
}

0 commit comments

Comments
 (0)