@Test public void shouldRecordAndPublishWithPublishedEvent() throws ConcurrentEventException, EventStoreException, JsonProcessingException { mockCommon(intermediateEvent); EventKey actual = compositeRepository.recordAndPublish(intermediateEvent); assertCommon(intermediateEvent); assertThat(actual, equalTo(eventKey)); assertThat(previousEventKeyCaptor.getValue(), equalTo(Optional.empty())); assertThat(concurrencyResolverFactoryCaptor.getValue().apply(new EntityEvent()).getClass(), equalTo(DefaultConcurrencyResolver.class)); }
@Override public <P extends PublishedEvent> EventKey recordAndPublish(P publishedEvent) throws EventStoreException, ConcurrentEventException { return recordAndPublishInternal(publishedEvent, Optional.empty(), entityEvent -> new DefaultConcurrencyResolver()); }
CompositeRepositoryImpl implements EventRepository { @Override public <P extends PublishedEvent> EventKey recordAndPublish(P publishedEvent) throws EventStoreException, ConcurrentEventException { return recordAndPublishInternal(publishedEvent, Optional.empty(), entityEvent -> new DefaultConcurrencyResolver()); } }
CompositeRepositoryImpl implements EventRepository { @Override public <P extends PublishedEvent> EventKey recordAndPublish(P publishedEvent) throws EventStoreException, ConcurrentEventException { return recordAndPublishInternal(publishedEvent, Optional.empty(), entityEvent -> new DefaultConcurrencyResolver()); } CompositeRepositoryImpl(EventRecorder eventRecorder, ObjectMapper objectMapper,
                                   IOperationRepository operationRepository); }
CompositeRepositoryImpl implements EventRepository { @Override public <P extends PublishedEvent> EventKey recordAndPublish(P publishedEvent) throws EventStoreException, ConcurrentEventException { return recordAndPublishInternal(publishedEvent, Optional.empty(), entityEvent -> new DefaultConcurrencyResolver()); } CompositeRepositoryImpl(EventRecorder eventRecorder, ObjectMapper objectMapper,
                                   IOperationRepository operationRepository); @Override List<EntityEvent> markFail(String opId); @Override EventKey recordAndPublish(P publishedEvent); @Override EventKey recordAndPublish(Entity previousEntity, P publishedEvent); @Override EventKey recordAndPublish(EventKey previousEventKey, P publishedEvent); @Override EventKey recordAndPublish(
            Entity previousEntity, P publishedEvent, Function<EntityEvent, ConcurrencyResolver<T>> concurrencyResolverFactory
    ); @Override EventKey recordAndPublish(
            EventKey eventKey, P publishedEvent, Function<EntityEvent, ConcurrencyResolver<T>> concurrencyResolverFactory
    ); @Override EventKey recordAndPublish(
            Entity entity, P publishedEvent, Supplier<ConcurrentEventResolver<P, T>> concurrencyResolverFactory
    ); @Override EventKey recordAndPublish(
            EventKey previousEventKey, P publishedEvent, Supplier<ConcurrentEventResolver<P, T>> concurrencyResolverFactory
    ); @Override EventRecorder getEventRecorder(); }
CompositeRepositoryImpl implements EventRepository { @Override public <P extends PublishedEvent> EventKey recordAndPublish(P publishedEvent) throws EventStoreException, ConcurrentEventException { return recordAndPublishInternal(publishedEvent, Optional.empty(), entityEvent -> new DefaultConcurrencyResolver()); } CompositeRepositoryImpl(EventRecorder eventRecorder, ObjectMapper objectMapper,
                                   IOperationRepository operationRepository); @Override List<EntityEvent> markFail(String opId); @Override EventKey recordAndPublish(P publishedEvent); @Override EventKey recordAndPublish(Entity previousEntity, P publishedEvent); @Override EventKey recordAndPublish(EventKey previousEventKey, P publishedEvent); @Override EventKey recordAndPublish(
            Entity previousEntity, P publishedEvent, Function<EntityEvent, ConcurrencyResolver<T>> concurrencyResolverFactory
    ); @Override EventKey recordAndPublish(
            EventKey eventKey, P publishedEvent, Function<EntityEvent, ConcurrencyResolver<T>> concurrencyResolverFactory
    ); @Override EventKey recordAndPublish(
            Entity entity, P publishedEvent, Supplier<ConcurrentEventResolver<P, T>> concurrencyResolverFactory
    ); @Override EventKey recordAndPublish(
            EventKey previousEventKey, P publishedEvent, Supplier<ConcurrentEventResolver<P, T>> concurrencyResolverFactory
    ); @Override EventRecorder getEventRecorder();  }