@Test void testSagaAddedToCacheOnAdd() { testSubject.insertSaga(StubSaga.class, "123", new StubSaga(), singleton(new AssociationValue("key", "value"))); verify(sagaCache).put(eq("123"), any()); verify(associationsCache, never()).put(any(), any()); }
@Override public void insertSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga, Set<AssociationValue> associationValues) { delegate.insertSaga(sagaType, sagaIdentifier, saga, associationValues); sagaCache.put(sagaIdentifier, new CacheEntry<>(saga, associationValues)); addCachedAssociations(associationValues, sagaIdentifier, sagaType); }
CachingSagaStore implements SagaStore<T> { @Override public void insertSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga, Set<AssociationValue> associationValues) { delegate.insertSaga(sagaType, sagaIdentifier, saga, associationValues); sagaCache.put(sagaIdentifier, new CacheEntry<>(saga, associationValues)); addCachedAssociations(associationValues, sagaIdentifier, sagaType); } }
CachingSagaStore implements SagaStore<T> { @Override public void insertSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga, Set<AssociationValue> associationValues) { delegate.insertSaga(sagaType, sagaIdentifier, saga, associationValues); sagaCache.put(sagaIdentifier, new CacheEntry<>(saga, associationValues)); addCachedAssociations(associationValues, sagaIdentifier, sagaType); } protected  CachingSagaStore(Builder<T> builder); }
CachingSagaStore implements SagaStore<T> { @Override public void insertSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga, Set<AssociationValue> associationValues) { delegate.insertSaga(sagaType, sagaIdentifier, saga, associationValues); sagaCache.put(sagaIdentifier, new CacheEntry<>(saga, associationValues)); addCachedAssociations(associationValues, sagaIdentifier, sagaType); } protected  CachingSagaStore(Builder<T> builder); static Builder<T> builder(); @Override Set<String> findSagas(Class<? extends T> sagaType, AssociationValue associationValue); @Override Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier); @Override void insertSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga,
                           Set<AssociationValue> associationValues); @Override void deleteSaga(Class<? extends T> sagaType, String sagaIdentifier,
                           Set<AssociationValue> associationValues); @Override void updateSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga,
                           AssociationValues associationValues); }
CachingSagaStore implements SagaStore<T> { @Override public void insertSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga, Set<AssociationValue> associationValues) { delegate.insertSaga(sagaType, sagaIdentifier, saga, associationValues); sagaCache.put(sagaIdentifier, new CacheEntry<>(saga, associationValues)); addCachedAssociations(associationValues, sagaIdentifier, sagaType); } protected  CachingSagaStore(Builder<T> builder); static Builder<T> builder(); @Override Set<String> findSagas(Class<? extends T> sagaType, AssociationValue associationValue); @Override Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier); @Override void insertSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga,
                           Set<AssociationValue> associationValues); @Override void deleteSaga(Class<? extends T> sagaType, String sagaIdentifier,
                           Set<AssociationValue> associationValues); @Override void updateSaga(Class<? extends T> sagaType, String sagaIdentifier, T saga,
                           AssociationValues associationValues);  }