|
|
@ -94,15 +94,13 @@ public class HibernateJpaAutoConfigurationTests {
|
|
|
|
public void testOpenEntityManagerInViewInterceptorNotRegisteredWhenFilterPresent()
|
|
|
|
public void testOpenEntityManagerInViewInterceptorNotRegisteredWhenFilterPresent()
|
|
|
|
throws Exception {
|
|
|
|
throws Exception {
|
|
|
|
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
|
|
|
|
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
|
|
|
|
context.register(ComponentScanDetectorConfiguration.class,
|
|
|
|
context.register(TestFilterConfiguration.class,
|
|
|
|
|
|
|
|
ComponentScanDetectorConfiguration.class,
|
|
|
|
EmbeddedDatabaseConfiguration.class, HibernateJpaAutoConfiguration.class,
|
|
|
|
EmbeddedDatabaseConfiguration.class, HibernateJpaAutoConfiguration.class,
|
|
|
|
PropertyPlaceholderAutoConfiguration.class, TestFilterConfiguration.class);
|
|
|
|
PropertyPlaceholderAutoConfiguration.class);
|
|
|
|
this.context = context;
|
|
|
|
this.context = context;
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
assertEquals(
|
|
|
|
assertEquals(0, getInterceptorBeans().length);
|
|
|
|
0,
|
|
|
|
|
|
|
|
this.context
|
|
|
|
|
|
|
|
.getBeanNamesForType(OpenEntityManagerInViewInterceptor.class).length);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -116,10 +114,11 @@ public class HibernateJpaAutoConfigurationTests {
|
|
|
|
PropertyPlaceholderAutoConfiguration.class);
|
|
|
|
PropertyPlaceholderAutoConfiguration.class);
|
|
|
|
this.context = context;
|
|
|
|
this.context = context;
|
|
|
|
this.context.refresh();
|
|
|
|
this.context.refresh();
|
|
|
|
assertEquals(
|
|
|
|
assertEquals(0, getInterceptorBeans().length);
|
|
|
|
0,
|
|
|
|
}
|
|
|
|
this.context
|
|
|
|
|
|
|
|
.getBeanNamesForType(OpenEntityManagerInViewInterceptor.class).length);
|
|
|
|
private String[] getInterceptorBeans() {
|
|
|
|
|
|
|
|
return this.context.getBeanNamesForType(OpenEntityManagerInViewInterceptor.class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ComponentScan(basePackageClasses = { City.class })
|
|
|
|
@ComponentScan(basePackageClasses = { City.class })
|
|
|
|