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 1919import org .junit .jupiter .api .Test ;
2020
2121import org .springframework .aop .config .AopConfigUtils ;
22+ import org .springframework .aop .framework .autoproxy .AutoProxyUtils ;
2223import org .springframework .beans .factory .config .BeanDefinition ;
2324import org .springframework .boot .autoconfigure .AutoConfigurations ;
2425import org .springframework .boot .test .context .runner .ApplicationContextRunner ;
@@ -40,16 +41,17 @@ class NonAspectJAopAutoConfigurationTests {
4041 @ Test
4142 void whenAspectJIsAbsentAndProxyTargetClassIsEnabledProxyCreatorBeanIsDefined () {
4243 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 );
4647 });
4748 }
4849
4950 @ Test
5051 void whenAspectJIsAbsentAndProxyTargetClassIsDisabledNoProxyCreatorBeanIsDefined () {
5152 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 ));
5355 }
5456
5557}
You can’t perform that action at this time.
0 commit comments