PathNode { URLHandler register(String pathPattern) { return register(pathPattern, Path.parse(pathPattern).next); } PathNode(String param);   }
@Test void conflictDynamicPathPattern() { root.register("/path1/:var1/path2"); assertThatThrownBy(() -> root.register("/path1/:var2/path3")) .isInstanceOf(Error.class) .hasMessageContaining("param=var2, conflictedParam=var1"); }
@Test void conflictWildcardPathPattern() { root.register("/path/:var1(*)"); assertThatThrownBy(() -> root.register("/path/:var2(*)")) .isInstanceOf(Error.class) .hasMessageContaining("param=var2, conflictedParam=var1"); }
@Test void invalidWildcardVariable() { assertThatThrownBy(() -> root.register("/path/:var1(*)/")) .isInstanceOf(Error.class) .hasMessageContaining("wildcard path variable must be the last"); }