@Test void loadShouldReturnEmptyIfNoConfigurationStored(EventStore eventStore) { EventsourcingConfigurationManagement testee = createConfigurationManagement(eventStore); assertThat(Mono.from(testee.load()).blockOptional()) .isEmpty(); }
@VisibleForTesting Mono<CassandraMailQueueViewConfiguration> load() { return Mono.from(eventStore.getEventsOfAggregate(CONFIGURATION_AGGREGATE_ID)) .map(history -> ConfigurationAggregate .load(CONFIGURATION_AGGREGATE_ID, history) .getCurrentConfiguration()) .handle(publishIfPresent()); }
EventsourcingConfigurationManagement { @VisibleForTesting Mono<CassandraMailQueueViewConfiguration> load() { return Mono.from(eventStore.getEventsOfAggregate(CONFIGURATION_AGGREGATE_ID)) .map(history -> ConfigurationAggregate .load(CONFIGURATION_AGGREGATE_ID, history) .getCurrentConfiguration()) .handle(publishIfPresent()); } }
EventsourcingConfigurationManagement { @VisibleForTesting Mono<CassandraMailQueueViewConfiguration> load() { return Mono.from(eventStore.getEventsOfAggregate(CONFIGURATION_AGGREGATE_ID)) .map(history -> ConfigurationAggregate .load(CONFIGURATION_AGGREGATE_ID, history) .getCurrentConfiguration()) .handle(publishIfPresent()); } @Inject  EventsourcingConfigurationManagement(EventStore eventStore); }
EventsourcingConfigurationManagement { @VisibleForTesting Mono<CassandraMailQueueViewConfiguration> load() { return Mono.from(eventStore.getEventsOfAggregate(CONFIGURATION_AGGREGATE_ID)) .map(history -> ConfigurationAggregate .load(CONFIGURATION_AGGREGATE_ID, history) .getCurrentConfiguration()) .handle(publishIfPresent()); } @Inject  EventsourcingConfigurationManagement(EventStore eventStore); void registerConfiguration(CassandraMailQueueViewConfiguration newConfiguration); }
EventsourcingConfigurationManagement { @VisibleForTesting Mono<CassandraMailQueueViewConfiguration> load() { return Mono.from(eventStore.getEventsOfAggregate(CONFIGURATION_AGGREGATE_ID)) .map(history -> ConfigurationAggregate .load(CONFIGURATION_AGGREGATE_ID, history) .getCurrentConfiguration()) .handle(publishIfPresent()); } @Inject  EventsourcingConfigurationManagement(EventStore eventStore); void registerConfiguration(CassandraMailQueueViewConfiguration newConfiguration);  }