bug in Given-when-then test fixture detects state changes outside of Aggregate’s Event Handler methods

7 views
Skip to first unread message

wlbkeats

unread,
Feb 23, 2012, 12:10:19 AM2/23/12
to Axon Framework Users
ComparationEntry add to comparedEntries twice, so the second time
comparedEntries.add(new ComparationEntry(workingValue,
eventSourcedValue) will aways return false! Then it will never do
fields value compare.

private void
assertValidWorkingAggregateState(EventSourcedAggregateRoot
eventSourcedAggregate) {
HashSet<ComparationEntry> comparedEntries = new
HashSet<ComparationEntry>();
comparedEntries.add(new ComparationEntry(workingAggregate,
eventSourcedAggregate));
...
}


private void ensureValuesEqual(Object workingValue, Object
eventSourcedValue, String propertyPath,
Set<ComparationEntry>
comparedEntries) {
if (explicitlyUnequal(workingValue, eventSourcedValue)) {
...
} else if (comparedEntries.add(new
ComparationEntry(workingValue, eventSourcedValue))
&& workingValue != null && !
hasEqualsMethod(workingValue.getClass())) {
...
}
}

Reply all
Reply to author
Forward
0 new messages