@Test public void shouldThrowExceptionWhenObjectWriterThrowsException() throws JsonProcessingException, ConcurrentEventException, EventStoreException { expectedException.expect(EventStoreException.class); doThrow(JsonProcessingException.class).when(objectWriter).writeValueAsString(intermediateEvent); compositeRepository.recordAndPublish(intermediateEvent); }
@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();  }