File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/aop Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 19
19
import org .junit .jupiter .api .Test ;
20
20
21
21
import org .springframework .aop .config .AopConfigUtils ;
22
+ import org .springframework .aop .framework .autoproxy .AutoProxyUtils ;
22
23
import org .springframework .beans .factory .config .BeanDefinition ;
23
24
import org .springframework .boot .autoconfigure .AutoConfigurations ;
24
25
import org .springframework .boot .test .context .runner .ApplicationContextRunner ;
@@ -40,16 +41,17 @@ class NonAspectJAopAutoConfigurationTests {
40
41
@ Test
41
42
void whenAspectJIsAbsentAndProxyTargetClassIsEnabledProxyCreatorBeanIsDefined () {
42
43
this .contextRunner .run ((context ) -> {
43
- BeanDefinition autoProxyCreator = context .getBeanFactory ()
44
- .getBeanDefinition (AopConfigUtils . AUTO_PROXY_CREATOR_BEAN_NAME );
45
- assertThat (autoProxyCreator .getPropertyValues ().get ("proxyTargetClass" )).isEqualTo (Boolean .TRUE );
44
+ BeanDefinition defaultProxyConfig = context .getBeanFactory ()
45
+ .getBeanDefinition (AutoProxyUtils . DEFAULT_PROXY_CONFIG_BEAN_NAME );
46
+ assertThat (defaultProxyConfig .getPropertyValues ().get ("proxyTargetClass" )).isEqualTo (Boolean .TRUE );
46
47
});
47
48
}
48
49
49
50
@ Test
50
51
void whenAspectJIsAbsentAndProxyTargetClassIsDisabledNoProxyCreatorBeanIsDefined () {
51
52
this .contextRunner .withPropertyValues ("spring.aop.proxy-target-class:false" )
52
- .run ((context ) -> assertThat (context ).doesNotHaveBean (AopConfigUtils .AUTO_PROXY_CREATOR_BEAN_NAME ));
53
+ .run ((context ) -> assertThat (context ).doesNotHaveBean (AutoProxyUtils .DEFAULT_PROXY_CONFIG_BEAN_NAME )
54
+ .doesNotHaveBean (AopConfigUtils .AUTO_PROXY_CREATOR_BEAN_NAME ));
53
55
}
54
56
55
57
}
You can’t perform that action at this time.
0 commit comments