From 7d824a5701054a01ea043a00d3e58431681e9370 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 11 Jul 2013 11:29:17 -0700 Subject: [PATCH] Fix accidentally broken test --- .../HibernateJpaAutoConfigurationTests.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/spring-autoconfigure/src/test/java/org/springframework/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java b/spring-autoconfigure/src/test/java/org/springframework/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java index ea034ebb89..5330efae5d 100644 --- a/spring-autoconfigure/src/test/java/org/springframework/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java +++ b/spring-autoconfigure/src/test/java/org/springframework/autoconfigure/orm/jpa/HibernateJpaAutoConfigurationTests.java @@ -94,15 +94,13 @@ public class HibernateJpaAutoConfigurationTests { public void testOpenEntityManagerInViewInterceptorNotRegisteredWhenFilterPresent() throws Exception { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); - context.register(ComponentScanDetectorConfiguration.class, + context.register(TestFilterConfiguration.class, + ComponentScanDetectorConfiguration.class, EmbeddedDatabaseConfiguration.class, HibernateJpaAutoConfiguration.class, - PropertyPlaceholderAutoConfiguration.class, TestFilterConfiguration.class); + PropertyPlaceholderAutoConfiguration.class); this.context = context; this.context.refresh(); - assertEquals( - 0, - this.context - .getBeanNamesForType(OpenEntityManagerInViewInterceptor.class).length); + assertEquals(0, getInterceptorBeans().length); } @Test @@ -116,10 +114,11 @@ public class HibernateJpaAutoConfigurationTests { PropertyPlaceholderAutoConfiguration.class); this.context = context; this.context.refresh(); - assertEquals( - 0, - this.context - .getBeanNamesForType(OpenEntityManagerInViewInterceptor.class).length); + assertEquals(0, getInterceptorBeans().length); + } + + private String[] getInterceptorBeans() { + return this.context.getBeanNamesForType(OpenEntityManagerInViewInterceptor.class); } @ComponentScan(basePackageClasses = { City.class })