Small assertions improvements
See gh-34796
This commit is contained in:
committed by
Moritz Halbritter
parent
cb2773da21
commit
d802ca017b
@@ -90,10 +90,7 @@ class AopAutoConfigurationTests {
|
||||
void whenGlobalMethodSecurityIsEnabledAndAspectJIsNotAvailableThenClassProxyingIsStillUsedByDefault() {
|
||||
this.contextRunner.withClassLoader(new FilteredClassLoader(Advice.class))
|
||||
.withUserConfiguration(ExampleController.class, EnableGlobalMethodSecurityConfiguration.class)
|
||||
.run((context) -> {
|
||||
ExampleController exampleController = context.getBean(ExampleController.class);
|
||||
assertThat(AopUtils.isCglibProxy(exampleController)).isTrue();
|
||||
});
|
||||
.run((context) -> assertThat(context).getBean(ExampleController.class).matches(AopUtils::isCglibProxy));
|
||||
}
|
||||
|
||||
private ContextConsumer<AssertableApplicationContext> proxyTargetClassEnabled() {
|
||||
|
||||
@@ -655,10 +655,8 @@ class WebFluxAutoConfigurationTests {
|
||||
this.contextRunner.withConfiguration(AutoConfigurations.of(AopAutoConfiguration.class))
|
||||
.withBean(ExceptionHandlerInterceptor.class)
|
||||
.withPropertyValues("spring.webflux.problemdetails.enabled:true")
|
||||
.run((context) -> {
|
||||
assertThat(context).hasSingleBean(ProblemDetailsExceptionHandler.class);
|
||||
assertThat(AopUtils.isCglibProxy(context.getBean(ProblemDetailsExceptionHandler.class))).isTrue();
|
||||
});
|
||||
.run((context) -> assertThat(context).getBean(ProblemDetailsExceptionHandler.class)
|
||||
.matches(AopUtils::isCglibProxy));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -998,10 +998,8 @@ class WebMvcAutoConfigurationTests {
|
||||
this.contextRunner.withConfiguration(AutoConfigurations.of(AopAutoConfiguration.class))
|
||||
.withBean(ExceptionHandlerInterceptor.class)
|
||||
.withPropertyValues("spring.mvc.problemdetails.enabled:true")
|
||||
.run((context) -> {
|
||||
assertThat(context).hasSingleBean(ProblemDetailsExceptionHandler.class);
|
||||
assertThat(AopUtils.isCglibProxy(context.getBean(ProblemDetailsExceptionHandler.class))).isTrue();
|
||||
});
|
||||
.run((context) -> assertThat(context).getBean(ProblemDetailsExceptionHandler.class)
|
||||
.matches(AopUtils::isCglibProxy));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user