Skip to content

Commit e064b50

Browse files
christophstroblmp911de
authored andcommitted
Prevent sync client from being created in reactive test config.
Closes #3817 Original pull request: #3987.
1 parent 7df2bdf commit e064b50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/MongoTestTemplateConfiguration.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ MongoConverter mongoConverter() {
6565

6666
if (converter == null) {
6767

68-
converter = new MappingMongoConverter(new DefaultDbRefResolver(databaseFactory()), mappingContext());
68+
if(dbFactoryConfig.syncClient != null || syncClient != null) {
69+
converter = new MappingMongoConverter(new DefaultDbRefResolver(databaseFactory()), mappingContext());
70+
} else {
71+
converter = new MappingMongoConverter(NoOpDbRefResolver.INSTANCE, mappingContext());
72+
}
6973

7074
if (mongoConverterConfigurer.customConversions != null) {
7175
converter.setCustomConversions(mongoConverterConfigurer.customConversions);

0 commit comments

Comments
 (0)