use of org.neo4j.ogm.session.event.PersistenceEvent in project spring-boot by spring-projects.
the class Neo4jDataAutoConfigurationTests method eventListenersAreAutoRegistered.
@Test
public void eventListenersAreAutoRegistered() {
load(EventListenerConfiguration.class);
Session session = this.context.getBean(SessionFactory.class).openSession();
session.notifyListeners(new PersistenceEvent(null, Event.TYPE.PRE_SAVE));
verify(this.context.getBean("eventListenerOne", EventListener.class)).onPreSave(any(Event.class));
verify(this.context.getBean("eventListenerTwo", EventListener.class)).onPreSave(any(Event.class));
}
Aggregations