From e24c17d5249a5467218ca65dc9878f3de4391018 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 17 Apr 2019 15:36:58 +0200 Subject: [PATCH] Polish "Add auto-configuration support for ReactiveGridFsTemplate" Closes gh-16467 --- .../mongo/MongoReactiveDataAutoConfiguration.java | 2 +- .../MongoReactiveDataAutoConfigurationTests.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java index e6e0e4c516..558de32cd6 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfiguration.java @@ -91,7 +91,7 @@ public class MongoReactiveDataAutoConfiguration { @Bean @ConditionalOnMissingBean - public DataBufferFactory dataBufferFactory() { + public DefaultDataBufferFactory dataBufferFactory() { return new DefaultDataBufferFactory(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfigurationTests.java index 3e23a6b25b..1fbda3cdcc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveDataAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,12 @@ public class MongoReactiveDataAutoConfigurationTests { .hasSingleBean(ReactiveMongoTemplate.class)); } + @Test + public void gridFsTemplateExists() { + this.contextRunner.run((context) -> assertThat(context) + .hasSingleBean(ReactiveGridFsTemplate.class)); + } + @Test public void backsOffIfMongoClientBeanIsNotPresent() { ApplicationContextRunner runner = new ApplicationContextRunner() @@ -57,10 +63,4 @@ public class MongoReactiveDataAutoConfigurationTests { .doesNotHaveBean(MongoReactiveDataAutoConfiguration.class)); } - @Test - public void gridFsTemplateExists() { - this.contextRunner.run((context) -> assertThat(context) - .hasSingleBean(ReactiveGridFsTemplate.class)); - } - }