@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); }
@Test public void testGetClassAnnotationsWithNull() throws Exception { assertNull(ReflectionUtils.getClassAnnotation(null, null)); }