It is a few years later now, and since you are using Spring, what you are asking for is sort of possible now using the @AliasFor annotation.
For example:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@SpringApplicationConfiguration
@ActiveProfiles("test")
public @interface SpringContextTest {
@AliasFor(annotation = SpringApplicationConfiguration.class, attribute = "classes")
Class<?>[] value() default {};
@AliasFor("value")
Class<?>[] classes() default {};
}
Now you can annotate your test with @SpringContextTest(MyConfig.class), and the amazing thing is that it actually works the way you would expect.
N.B. When you need to programmatically get the attribute values, the Spring automagical aliasing works only when you use AnnotatedElementUtils instead of AnnotationUtils, as the documentation says:
AnnotatedElementUtilsdefines the public API for Spring’s meta-annotation programming model with support for annotation attribute overrides. If you do not need support for annotation attribute overrides, consider usingAnnotationUtilsinstead.
Example:
final Named namedAnnotation = AnnotatedElementUtils.findMergedAnnotation(Person.class, Named.class);
final String name = namedAnnotation.name();
assertEquals("Steve", name);