mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 14:12:11 +00:00
test for revoking event
This commit is contained in:
1 parent
cb0aba5c35
commit
b0ac63b0b7
2 files changed
+4
-1
No files matched your search
+3
@@ -4,6 +4,7 @@ import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -69,6 +70,8 @@ public class FinishingTimeFinderTest extends PassAwareRaceLogAnalyzerTest<Finish
|
||||
RaceLogRaceStatusEvent event1 = createEvent(RaceLogRaceStatusEvent.class, 1);
|
||||
when(event1.getNextStatus()).thenReturn(RaceLogRaceStatus.FINISHING);
|
||||
RaceLogRevokeEvent revokeEvent = createEvent(RaceLogRevokeEvent.class,1);
|
||||
final Serializable id = event1.getId();
|
||||
when(revokeEvent.getRevokedEventId()).thenReturn(id);
|
||||
RaceLogRaceStatusEvent event2 = createEvent(RaceLogRaceStatusEvent.class, 1);
|
||||
when(event2.getNextStatus()).thenReturn(RaceLogRaceStatus.FINISHING);
|
||||
raceLog.add(event1);
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ public class FinishingTimeFinder extends RaceLogAnalyzer<TimePoint> {
|
||||
|
||||
@Override
|
||||
protected TimePoint performAnalysis() {
|
||||
for (RaceLogEvent event : log.getUnrevokedEventsDescending()) {
|
||||
for (RaceLogEvent event : log.getUnrevokedEvents()) {
|
||||
if (event instanceof RaceLogRaceStatusEvent) {
|
||||
RaceLogRaceStatusEvent statusEvent = (RaceLogRaceStatusEvent) event;
|
||||
if (statusEvent.getNextStatus().equals(RaceLogRaceStatus.FINISHING)) {
|
||||
|
||||
Reference in new issue
Block a user