コード例 #1
0
  @Test
  public void should_able_to_handle_default_path() {
    resolver.init(servletConfig);

    Class<?> controllerForArticleClass = resolver.getControllerFor("/demo/article");
    assertThat(controllerForArticleClass == TestPathAnnotationController.class, is(true));
  }
コード例 #2
0
  @Test
  public void should_able_to_resolve_the_controller_mapping_based_on_annotation() {
    resolver.init(servletConfig);

    Class<?> controllerForArticleClass = resolver.getControllerFor("/demo/article/create");
    assertThat(controllerForArticleClass == TestPathAnnotationController.class, is(true));
  }