EventRecorder#assertRefUpdatedEvents: Fix NPE when expecting null ref
Change-Id: Iedd92690d7045f394c777613b33b6f44a34ab377
This commit is contained in:
@@ -155,8 +155,14 @@ public class EventRecorder {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for (RefUpdatedEvent event : events) {
|
for (RefUpdatedEvent event : events) {
|
||||||
RefUpdateAttribute actual = event.refUpdate.get();
|
RefUpdateAttribute actual = event.refUpdate.get();
|
||||||
assertThat(actual.oldRev).isEqualTo(expected[i].name());
|
String oldRev = expected[i] == null
|
||||||
assertThat(actual.newRev).isEqualTo(expected[i+1].name());
|
? ObjectId.zeroId().name()
|
||||||
|
: expected[i].name();
|
||||||
|
String newRev = expected[i+1] == null
|
||||||
|
? ObjectId.zeroId().name()
|
||||||
|
: expected[i+1].name();
|
||||||
|
assertThat(actual.oldRev).isEqualTo(oldRev);
|
||||||
|
assertThat(actual.newRev).isEqualTo(newRev);
|
||||||
i += 2;
|
i += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user