Exemplo n.º 1
0
  @Test
  public void replaceUriTemplateParamsTemplateWithoutParamMatch() throws JspException {
    List<Param> params = new LinkedList<Param>();
    Set<String> usedParams = new HashSet<String>();

    String uri = tag.replaceUriTemplateParams("url/{path}", params, usedParams);

    assertEquals("url/{path}", uri);
    assertEquals(0, usedParams.size());
  }
Exemplo n.º 2
0
  @Test
  public void replaceUriTemplateParamsTemplateWithPath() throws JspException {
    List<Param> params = new LinkedList<Param>();
    Set<String> usedParams = new HashSet<String>();

    Param param = new Param();
    param.setName("name");
    param.setValue("my/Id");
    params.add(param);

    String uri = tag.replaceUriTemplateParams("url/{name}", params, usedParams);

    assertEquals("url/my/Id", uri);
    assertEquals(1, usedParams.size());
    assertTrue(usedParams.contains("name"));
  }