From c13cab0b6789bc017a2f7253e97d7fdebe285cd1 Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Thu, 28 Oct 2021 20:50:54 +0200 Subject: [PATCH] #1683 - Backport of tests. Backport of the tests introduced with 071256 to make sure the problem doesn't exist in this branch. --- .../org/springframework/hateoas/UriTemplateUnitTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/org/springframework/hateoas/UriTemplateUnitTest.java b/src/test/java/org/springframework/hateoas/UriTemplateUnitTest.java index ab23eae4..846a22af 100755 --- a/src/test/java/org/springframework/hateoas/UriTemplateUnitTest.java +++ b/src/test/java/org/springframework/hateoas/UriTemplateUnitTest.java @@ -348,6 +348,15 @@ class UriTemplateUnitTest { assertThat(UriTemplate.isTemplate("http://localhost/api/rest/v1/userGroups/50/functions/{?id*}")).isTrue(); } + @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)); }