use of org.springframework.data.mapping.callback.ReactiveEntityCallbacks in project spring-data-mongodb by spring-projects.
the class ReactiveMongoTemplateUnitTests method setterForEntityCallbackOverridesContextInitializedOnes.
// DATAMONGO-2261
@Test
void setterForEntityCallbackOverridesContextInitializedOnes() {
ApplicationContext ctx = new StaticApplicationContext();
template.setApplicationContext(ctx);
ReactiveEntityCallbacks callbacks = ReactiveEntityCallbacks.create();
template.setEntityCallbacks(callbacks);
Assertions.assertThat(ReflectionTestUtils.getField(template, "entityCallbacks")).isSameAs(callbacks);
}
use of org.springframework.data.mapping.callback.ReactiveEntityCallbacks in project spring-data-mongodb by spring-projects.
the class ReactiveMongoTemplateUnitTests method setterForApplicationContextShouldNotOverrideAlreadySetEntityCallbacks.
// DATAMONGO-2261
@Test
void setterForApplicationContextShouldNotOverrideAlreadySetEntityCallbacks() {
ReactiveEntityCallbacks callbacks = ReactiveEntityCallbacks.create();
ApplicationContext ctx = new StaticApplicationContext();
template.setEntityCallbacks(callbacks);
template.setApplicationContext(ctx);
Assertions.assertThat(ReflectionTestUtils.getField(template, "entityCallbacks")).isSameAs(callbacks);
}
Aggregations