Enable Neo4J's open in view interceptor by default

Closes gh-7943
pull/7873/merge
Andy Wilkinson 8 years ago
parent 9159c87bf9
commit 65025d8dab

@ -120,7 +120,7 @@ public class Neo4jDataAutoConfiguration {
@ConditionalOnClass({ WebMvcConfigurerAdapter.class,
OpenSessionInViewInterceptor.class })
@ConditionalOnMissingBean(OpenSessionInViewInterceptor.class)
@ConditionalOnProperty(prefix = "spring.data.neo4j", name = "open-in-view", havingValue = "true")
@ConditionalOnProperty(prefix = "spring.data.neo4j", name = "open-in-view", havingValue = "true", matchIfMissing = true)
protected static class Neo4jWebConfiguration {
@Configuration

@ -78,7 +78,7 @@ public class Neo4jDataAutoConfigurationTests {
assertThat(this.context.getBeansOfType(Neo4jOperations.class)).hasSize(1);
assertThat(this.context.getBeansOfType(Neo4jTransactionManager.class)).hasSize(1);
assertThat(this.context.getBeansOfType(OpenSessionInViewInterceptor.class))
.isEmpty();
.hasSize(1);
}
@Test
@ -131,10 +131,10 @@ public class Neo4jDataAutoConfigurationTests {
}
@Test
public void openSessionInViewInterceptorCanBeEnabled() {
load(null, "spring.data.neo4j.open-in-view=true");
public void openSessionInViewInterceptorCanBeDisabled() {
load(null, "spring.data.neo4j.open-in-view:false");
assertThat(this.context.getBeansOfType(OpenSessionInViewInterceptor.class))
.hasSize(1);
.isEmpty();
}
@Test

Loading…
Cancel
Save