use of org.springframework.data.mongodb.core.mapping.PersonPojoStringId in project spring-data-mongodb by spring-projects.
the class ApplicationContextEventTests method publishesAfterConvertEventForFindQueriesUsingProjections.
// DATAMONGO-1823
@Test
public void publishesAfterConvertEventForFindQueriesUsingProjections() {
PersonPojoStringId entity = new PersonPojoStringId("1", "Text");
template.insert(entity);
template.query(PersonPojoStringId.class).matching(query(where("id").is(entity.getId()))).all();
assertThat(listener.onAfterLoadEvents).hasSize(1);
assertThat(listener.onAfterLoadEvents.get(0).getCollectionName()).isEqualTo(COLLECTION_NAME);
assertThat(listener.onBeforeConvertEvents).hasSize(1);
assertThat(listener.onBeforeConvertEvents.get(0).getCollectionName()).isEqualTo(COLLECTION_NAME);
assertThat(listener.onAfterConvertEvents).hasSize(1);
assertThat(listener.onAfterConvertEvents.get(0).getCollectionName()).isEqualTo(COLLECTION_NAME);
}
Aggregations