@Test @DisplayName("wrap test storage") void wrapTestStorage() { ServerEnvironment serverEnv = ServerEnvironment.instance(); StorageFactory testStorage = InMemoryStorageFactory.newInstance(); serverEnv.use(testStorage, Tests.class); StorageFactory storageFactory = serverEnv.storageFactory(); assertThat(storageFactory).isInstanceOf(SystemAwareStorageFactory.class); SystemAwareStorageFactory systemAware = (SystemAwareStorageFactory) storageFactory; assertThat(systemAware.delegate()).isEqualTo(testStorage); }
@VisibleForTesting public StorageFactory delegate() { return delegate; }
SystemAwareStorageFactory implements StorageFactory { @VisibleForTesting public StorageFactory delegate() { return delegate; } }
SystemAwareStorageFactory implements StorageFactory { @VisibleForTesting public StorageFactory delegate() { return delegate; } private  SystemAwareStorageFactory(StorageFactory delegate); }
SystemAwareStorageFactory implements StorageFactory { @VisibleForTesting public StorageFactory delegate() { return delegate; } private  SystemAwareStorageFactory(StorageFactory delegate); static SystemAwareStorageFactory wrap(StorageFactory factory); @VisibleForTesting StorageFactory delegate(); @Override AggregateStorage<I> createAggregateStorage(ContextSpec context,
                           Class<? extends Aggregate<I, ?, ?>> aggregateClass); @Override RecordStorage<I> createRecordStorage(ContextSpec context, Class<? extends Entity<I, ?>> entityClass); @Override ProjectionStorage<I> createProjectionStorage(ContextSpec context,
                            Class<? extends Projection<I, ?, ?>> projectionClass); @Override InboxStorage createInboxStorage(boolean multitenant); @Override CatchUpStorage createCatchUpStorage(boolean multitenant); @Override EventStore createEventStore(ContextSpec context); @Override void close(); }
SystemAwareStorageFactory implements StorageFactory { @VisibleForTesting public StorageFactory delegate() { return delegate; } private  SystemAwareStorageFactory(StorageFactory delegate); static SystemAwareStorageFactory wrap(StorageFactory factory); @VisibleForTesting StorageFactory delegate(); @Override AggregateStorage<I> createAggregateStorage(ContextSpec context,
                           Class<? extends Aggregate<I, ?, ?>> aggregateClass); @Override RecordStorage<I> createRecordStorage(ContextSpec context, Class<? extends Entity<I, ?>> entityClass); @Override ProjectionStorage<I> createProjectionStorage(ContextSpec context,
                            Class<? extends Projection<I, ?, ?>> projectionClass); @Override InboxStorage createInboxStorage(boolean multitenant); @Override CatchUpStorage createCatchUpStorage(boolean multitenant); @Override EventStore createEventStore(ContextSpec context); @Override void close();  }