@Test public void handlePostInsert() throws Exception { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); context.register(DomaEventEntityListener.class); context.register(DomaEventListenerFactory.class); context.register(PostInsertHandler.class); context.refresh(); DomaEventEntityListener<Entity> entityListener = context .getBean(DomaEventEntityListener.class); PostInsertContext ctx = mock(PostInsertContext.class); Entity entity = new Entity(); entityListener.postInsert(entity, ctx); PostInsertHandler handler = context.getBean(PostInsertHandler.class); assertThat(handler.entity).isSameAs(entity); }
@Override public void postInsert(T t, PostInsertContext<T> context) { this.eventPublisher.publishEvent(new PostInsertEvent<>(t, context)); }
DomaEventEntityListener extends NullEntityListener<T> implements
		ApplicationEventPublisherAware { @Override public void postInsert(T t, PostInsertContext<T> context) { this.eventPublisher.publishEvent(new PostInsertEvent<>(t, context)); } }
DomaEventEntityListener extends NullEntityListener<T> implements
		ApplicationEventPublisherAware { @Override public void postInsert(T t, PostInsertContext<T> context) { this.eventPublisher.publishEvent(new PostInsertEvent<>(t, context)); }  }
DomaEventEntityListener extends NullEntityListener<T> implements
		ApplicationEventPublisherAware { @Override public void postInsert(T t, PostInsertContext<T> context) { this.eventPublisher.publishEvent(new PostInsertEvent<>(t, context)); }  @Override void preInsert(T t, PreInsertContext<T> context); @Override void preUpdate(T t, PreUpdateContext<T> context); @Override void preDelete(T t, PreDeleteContext<T> context); @Override void postInsert(T t, PostInsertContext<T> context); @Override void postUpdate(T t, PostUpdateContext<T> context); @Override void postDelete(T t, PostDeleteContext<T> context); @Override void setApplicationEventPublisher(ApplicationEventPublisher eventPublisher); }
DomaEventEntityListener extends NullEntityListener<T> implements
		ApplicationEventPublisherAware { @Override public void postInsert(T t, PostInsertContext<T> context) { this.eventPublisher.publishEvent(new PostInsertEvent<>(t, context)); }  @Override void preInsert(T t, PreInsertContext<T> context); @Override void preUpdate(T t, PreUpdateContext<T> context); @Override void preDelete(T t, PreDeleteContext<T> context); @Override void postInsert(T t, PostInsertContext<T> context); @Override void postUpdate(T t, PostUpdateContext<T> context); @Override void postDelete(T t, PostDeleteContext<T> context); @Override void setApplicationEventPublisher(ApplicationEventPublisher eventPublisher);  }