Search in sources :

Example 1 with JerseyUriBuilder

use of org.glassfish.jersey.uri.internal.JerseyUriBuilder in project jersey by jersey.

the class JerseyWebTargetTest method testResolveTemplate2.

@Test
public void testResolveTemplate2() {
    final JerseyWebTarget newTarget = target.path("path/{a}").queryParam("query", "{q}").resolveTemplate("a", "param-a");
    final JerseyUriBuilder uriBuilder = (JerseyUriBuilder) newTarget.getUriBuilder();
    uriBuilder.resolveTemplate("q", "param-q").resolveTemplate("a", "will-be-ignored");
    assertEquals(URI.create("/path/param-a?query=param-q"), uriBuilder.build());
    final UriBuilder uriBuilderNew = newTarget.resolveTemplate("a", "will-be-ignored").resolveTemplate("q", "new-q").getUriBuilder();
    assertEquals(URI.create("/path/param-a?query=new-q"), uriBuilderNew.build());
}
Also used : JerseyUriBuilder(org.glassfish.jersey.uri.internal.JerseyUriBuilder) JerseyUriBuilder(org.glassfish.jersey.uri.internal.JerseyUriBuilder) UriBuilder(javax.ws.rs.core.UriBuilder) Test(org.junit.Test)

Aggregations

UriBuilder (javax.ws.rs.core.UriBuilder)1 JerseyUriBuilder (org.glassfish.jersey.uri.internal.JerseyUriBuilder)1 Test (org.junit.Test)1