Examples of resolveTemplates()


Examples of javax.ws.rs.client.WebTarget.resolveTemplates()

    }

    @Test
    public void testResolveTemplatesEmptyMap() {
        WebTarget wt = target;
        wt = wt.resolveTemplates(Collections.<String, Object>emptyMap());

        assertEquals(target, wt);
    }

    @Test
View Full Code Here

Examples of javax.ws.rs.client.WebTarget.resolveTemplates()

    }

    @Test
    public void testResolveTemplatesEncodeSlashEmptyMap() {
        WebTarget wt = target;
        wt = wt.resolveTemplates(Collections.<String, Object>emptyMap(), false);

        assertEquals(target, wt);
    }

}
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

                return "fred@example.com";
            }
        });
        map.put("w", "path-rootless/test2");
        UriBuilder builder = UriBuilder.fromPath("").path("{w}/{x}/{y}/{z}/{x}");
        URI uri = builder.resolveTemplates(map, false).build();
        assertEquals(expected, uri.getRawPath());
    }
   
    @Test
    public void testQueryParamWithTemplateValues() {
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

                return "fred@example.com";
            }
        });
        map.put("w", "path-rootless/test2");
        UriBuilder builder = UriBuilder.fromPath("").path("{w}/{x}/{y}/{z}/{x}");
        URI uri = builder.resolveTemplates(map).build();
       
        assertEquals(expected, uri.getRawPath());       
    }
   
    @Test
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

                return "fred@example.com";
            }
        });
        map.put("w", "path-rootless/test2");
        UriBuilder builder = UriBuilder.fromPath("").path("{w}/{x}/{y}/{z}/{x}");
        URI uri = builder.resolveTemplates(map, true).build();
        assertEquals(expected, uri.getRawPath());
    }

    @Test
    public void testResolveTemplatesMapBooleanSlashNotEncoded() throws Exception {
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

        Map<String, Object> resolveMap = new HashMap<String, Object>();
        resolveMap.put("a", "x/y/z%3F%20");
        resolveMap.put("q", "q?%20%26");
        resolveMap.put("c", "paramc1/paramc2");
        uriBuilder.resolveTemplates(resolveMap);
        Map<String, Object> buildMap = new HashMap<String, Object>();
        buildMap.put("b", "param-b/aaa");
        Assert.assertEquals("http://localhost:8080/x%2Fy%2Fz%253F%2520/param-b%2Faaa/paramc1%2Fparamc2?query=q?%2520%2526",
                uriBuilder.buildFromMap(buildMap).toString());
    }
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

        Map<String, Object> resolveMap = new HashMap<String, Object>();
        resolveMap.put("a", "x/y/z%3F%20");
        resolveMap.put("q", "q?%20%26");
        resolveMap.put("c", "paramc1/paramc2");
        uriBuilder.resolveTemplates(resolveMap, false);
        Map<String, Object> buildMap = new HashMap<String, Object>();
        buildMap.put("b", "param-b/aaa");
        Assert.assertEquals("http://localhost:8080/x/y/z%253F%2520/param-b/aaa/paramc1/paramc2?query=q?%2520%2526",
                uriBuilder.buildFromMap(buildMap, false).toString());
    }
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

        final UriBuilder uriBuilder = UriBuilder.fromPath("http://localhost:8080").path("{a}").path
                ("{b}").queryParam("query", "{q}");
        Map<String, Object> resolveMap = new HashMap<String, Object>();
        resolveMap.put("a", "param-a/withSlash");
        resolveMap.put("q", "param-q");
        uriBuilder.resolveTemplates(resolveMap, false);
        uriBuilder.resolveTemplate("b", "param-b/withEncodedSlash", true);
        Assert.assertEquals(URI.create("http://localhost:8080/param-a/withSlash/param-b%2FwithEncodedSlash?query=param-q"),
                uriBuilder.build());
        uriBuilder.build();
    }
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

    public void testResolveTemplate() {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("a", "xyz");
        map.put(null, "path");
        UriBuilder builder = UriBuilder.fromPath("").path("{a}/{b}");
        builder.resolveTemplates(map);
    }
}
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.resolveTemplates()

      template = builder.toTemplate();
      Assert.assertEquals(template, "http://localhost/x/y/{path}?name={qval}");
      Map<String, Object> values = new HashMap<String, Object>();
      values.put("path", "z");
      values.put("qval", new Integer(42));
      builder = builder.resolveTemplates(values);
      template = builder.toTemplate();
      Assert.assertEquals(template, "http://localhost/x/y/z?name=42");


   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.