コード例 #1
0
  @Test
  public void shouldFindApplicationPathAnnotatedClassInPackage() {
    ClassPathScanner scanner = new ClassPathScanner(PACKAGE_RESTAPIDOC_TEST);
    Set<Class<?>> classes = scanner.getClassesWithAnnotation(ApplicationPath.class);

    assertEquals(1, classes.size());

    for (Class<?> clazz : classes) {
      ApplicationPath annotation = clazz.getAnnotation(ApplicationPath.class);
      System.out.println(clazz + " path: " + annotation.value());
    }
  }
コード例 #2
0
  @Test
  public void shouldFindPathAnnotatedClassesInPackage() {
    ClassPathScanner scanner = new ClassPathScanner(PACKAGE_ORG_CAMUNDA_BPM_ENGINE_REST);
    Set<Class<?>> classes = scanner.getClassesWithAnnotation(Path.class);

    assertEquals(16, classes.size());

    for (Class<?> clazz : classes) {
      Path annotation = clazz.getAnnotation(Path.class);
      System.out.println(clazz + " path: " + annotation.value());
    }
  }