Ejemplo n.º 1
0
  @Test
  public void testVariableNames() {
    List<String> names = RouteUtil.pathVariableNames("/persons/{id}");
    Assert.assertEquals(1, names.size());
    Assert.assertEquals("id", names.get(0));

    List<String> names2 = RouteUtil.pathVariableNames("/persons/{id}/edit/{name}");
    Assert.assertEquals(2, names2.size());
    Assert.assertEquals("id", names2.get(0));
    Assert.assertEquals("name", names2.get(1));
  }
Ejemplo n.º 2
0
 @Test(expected = IllegalArgumentException.class)
 public void testVariableNames2() {
   RouteUtil.pathVariableNames("/persons/{id}/id/{id}");
 }