Tests for @Enable/@ComponentScan without @Configuration
Issue: SPR-10660
This commit is contained in:
parent
c95dfca726
commit
d18b3f049a
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2015 the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -96,13 +96,11 @@ public class EnableAspectJAutoProxyTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ComponentScan("example.scannable")
|
@ComponentScan("example.scannable")
|
||||||
@EnableAspectJAutoProxy
|
@EnableAspectJAutoProxy
|
||||||
static class ConfigWithJdkProxy {
|
static class ConfigWithJdkProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@ComponentScan("example.scannable")
|
@ComponentScan("example.scannable")
|
||||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||||
static class ConfigWithCglibProxy {
|
static class ConfigWithCglibProxy {
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class EnableAsyncTests {
|
||||||
@Test
|
@Test
|
||||||
public void customAsyncAnnotationIsPropagated() {
|
public void customAsyncAnnotationIsPropagated() {
|
||||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||||
ctx.register(CustomAsyncAnnotationConfig.class);
|
ctx.register(CustomAsyncAnnotationConfig.class, CustomAsyncBean.class);
|
||||||
ctx.refresh();
|
ctx.refresh();
|
||||||
|
|
||||||
Object bean = ctx.getBean(CustomAsyncBean.class);
|
Object bean = ctx.getBean(CustomAsyncBean.class);
|
||||||
|
@ -200,14 +200,8 @@ public class EnableAsyncTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
@EnableAsync(annotation = CustomAsync.class)
|
@EnableAsync(annotation = CustomAsync.class)
|
||||||
static class CustomAsyncAnnotationConfig {
|
static class CustomAsyncAnnotationConfig {
|
||||||
|
|
||||||
@Bean
|
|
||||||
public CustomAsyncBean asyncBean() {
|
|
||||||
return new CustomAsyncBean();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue