DATAMONGO-2586 - Polishing.

Add tests to ensure no reactive auditing callback is registered when using imperative configuration and vice versa.
Update wording and minor code style tweaks.

Original Pull Request: #877
This commit is contained in:
Christoph Strobl
2020-07-17 10:40:07 +02:00
parent 6bafcea539
commit a8a364c2de
4 changed files with 57 additions and 24 deletions

View File

@@ -30,9 +30,10 @@ To activate auditing functionality via XML, add the Spring Data Mongo `auditing`
----
====
If you wish to use auditing with the reactive programming model, then enable auditing through `@EnableReactiveMongoAuditing`
To enable auditing, leveraging a reactive programming model, use the `@EnableReactiveMongoAuditing` annotation. +
If you expose a bean of type `ReactiveAuditorAware` to the `ApplicationContext`, the auditing infrastructure picks it up automatically and uses it to determine the current user to be set on domain types. If you have multiple implementations registered in the `ApplicationContext`, you can select the one to be used by explicitly setting the `auditorAwareRef` attribute of `@EnableReactiveMongoAuditing`.
.Activating auditing using JavaConfig
.Activating reactive auditing using JavaConfig
====
[source,java]
----
@@ -47,5 +48,5 @@ class Config {
}
----
====
If you expose a bean of type `ReactiveAuditorAware` to the `ApplicationContext`, the auditing infrastructure picks it up automatically and uses it to determine the current user to be set on domain types. If you have multiple implementations registered in the `ApplicationContext`, you can select the one to be used by explicitly setting the `auditorAwareRef` attribute of `@EnableReactiveMongoAuditing`.