@DirtiesContext
@Test
public void testLoadSagaOfDifferentTypesWithSameAssociationValue_SagaFound() {
MyTestSaga testSaga = new MyTestSaga("test1");
MyOtherTestSaga otherTestSaga = new MyOtherTestSaga("test2");
testSaga.registerAssociationValue(new AssociationValue("key", "value"));
otherTestSaga.registerAssociationValue(new AssociationValue("key", "value"));
repository.add(testSaga);
repository.add(otherTestSaga);
Set<String> actual = repository.find(MyTestSaga.class, new AssociationValue("key", "value"));
assertEquals(1, actual.size());
assertEquals(MyTestSaga.class, repository.load(actual.iterator().next()).getClass());
Set<String> actual2 = repository.find(MyOtherTestSaga.class, new AssociationValue("key", "value"));
assertEquals(1, actual2.size());
assertEquals(MyOtherTestSaga.class, repository.load(actual2.iterator().next()).getClass());
DBObject sagaQuery = SagaEntry.queryByIdentifier("test1");
DBCursor sagaCursor = mongoTemplate.sagaCollection().find(sagaQuery);