Exemplo n.º 1
0
  @Test
  public void testClassAnnotation() {
    Annotation a = ReflectionUtils.getClassAnnotation(Bar.class, ControllerClass.class);
    assertNotNull(a);
    assertTrue(a instanceof ControllerClass);

    a = ReflectionUtils.getClassAnnotation(Alpha.class, ControllerClass.class);
    assertNotNull(a);
    assertTrue(a instanceof ControllerClass);

    a = ReflectionUtils.getClassAnnotation(Bogus.class, ControllerClass.class);
    assertNull(a);

    a = ReflectionUtils.getClassAnnotation(CCC.class, ControllerClass.class);
    assertNull(a);
  }
Exemplo n.º 2
0
 @Test
 public void testGetClassAnnotationsWithNull() throws Exception {
   assertNull(ReflectionUtils.getClassAnnotation(null, null));
 }