@Test void testActionAnnotationOnly() throws NoSuchMethodException { Method method = this.getClass().getMethod("hello"); ActionAnnotationValues annotationValues = annValueOf(method); assertNull(annotationValues.alias()); assertNull(annotationValues.value()); method = this.getClass().getMethod("hello2"); annotationValues = annValueOf(method); assertEquals("alias", annotationValues.alias); assertEquals("value.ext", annotationValues.value); }
@Test void testCustomActionAnnotation() throws NoSuchMethodException { final AnnotationParser annotationParser = parserFor(CustomAction.class); Method method = this.getClass().getMethod("hello3"); ActionAnnotationValues annotationValues = ActionAnnotationValues.of(annotationParser, method); assertEquals("ALIAS", annotationValues.alias()); assertNull(annotationValues.value()); method = this.getClass().getMethod("hello4"); annotationValues = ActionAnnotationValues.of(annotationParser, method); assertEquals("ALIAS", annotationValues.alias()); assertNull(annotationValues.value()); }
@Test void testMiscActionAnnotation() throws NoSuchMethodException { final AnnotationParser annotationParser = parserFor(MiscAnnotation.class); Method method = this.getClass().getMethod("hello5"); ActionAnnotationValues annotationValues = ActionAnnotationValues.of(annotationParser, method); assertNull(annotationValues.alias()); assertEquals("VAL", annotationValues.value()); method = this.getClass().getMethod("hello6"); annotationValues = ActionAnnotationValues.of(annotationParser, method); assertNull(annotationValues.alias()); assertEquals("VAL", annotationValues.value()); }