@Test public void orderAttributeIsPropagated() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(OrderedAsyncConfig.class); ctx.refresh(); AsyncAnnotationBeanPostProcessor bpp = ctx.getBean(AsyncAnnotationBeanPostProcessor.class); assertThat(bpp.getOrder(), is(Ordered.HIGHEST_PRECEDENCE)); }
@Test public void asyncProcessorIsOrderedLowestPrecedenceByDefault() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(AsyncConfig.class); ctx.refresh(); AsyncAnnotationBeanPostProcessor bpp = ctx.getBean(AsyncAnnotationBeanPostProcessor.class); assertThat(bpp.getOrder(), is(Ordered.LOWEST_PRECEDENCE)); }