@Test public void testTagSeenEvents_ShouldAddLap() throws Exception { Snapshot snapshot = new Snapshot(Instant.EPOCH); AddTagEvent addTagEvent = new AddTagEvent(Instant.EPOCH.plus(1, ChronoUnit.SECONDS), new TagId("ABCD"), 0); snapshot = addTagEvent.doApply(snapshot); StartEvent startEvent = new StartEvent(Instant.EPOCH.plus(2, ChronoUnit.SECONDS)); snapshot = startEvent.doApply(snapshot); TagSeenEvent tagSeenEvent = new TagSeenEvent(Instant.EPOCH.plus(3, ChronoUnit.SECONDS), new TagId("ABCD"), 0, 0L); snapshot = tagSeenEvent.doApply(snapshot); TagSeenEvent tagSeenEvent2 = new TagSeenEvent(Instant.EPOCH.plus(60, ChronoUnit.SECONDS), new TagId("ABCD"), 0, 1L); snapshot = tagSeenEvent2.doApply(snapshot); MatcherAssert.assertThat(snapshot.getTeamStates().getNbLapsForTeam(0), Matchers.equalTo(1)); }
public TeamStates getTeamStates() { return teamStates; }
Snapshot { public TeamStates getTeamStates() { return teamStates; } }
Snapshot { public TeamStates getTeamStates() { return teamStates; } @SuppressWarnings("unused") private  Snapshot();  Snapshot(Instant time); }
Snapshot { public TeamStates getTeamStates() { return teamStates; } @SuppressWarnings("unused") private  Snapshot();  Snapshot(Instant time); Optional<Long> getId(); Optional<Long> getEventId(); Instant getSnapshotTime(); TeamTagMap getTeamTagMap(); Instant getStartTime(); Instant getEndTime(); TeamStates getTeamStates(); TeamStates getPublicTeamStates(); String getStatusMessage(); Status getStatus(); int getUpdateFrequency(); static Builder builder(Instant time, Snapshot other); static Optional<Snapshot> loadForEvent(Connection connection, Event event); static Optional<Snapshot> loadLatest(Connection connection); static Optional<Snapshot> loadBefore(Connection connection, Instant time); void save(Connection connection); static void deleteAfter(Connection connection, Snapshot snapshot); }
Snapshot { public TeamStates getTeamStates() { return teamStates; } @SuppressWarnings("unused") private  Snapshot();  Snapshot(Instant time); Optional<Long> getId(); Optional<Long> getEventId(); Instant getSnapshotTime(); TeamTagMap getTeamTagMap(); Instant getStartTime(); Instant getEndTime(); TeamStates getTeamStates(); TeamStates getPublicTeamStates(); String getStatusMessage(); Status getStatus(); int getUpdateFrequency(); static Builder builder(Instant time, Snapshot other); static Optional<Snapshot> loadForEvent(Connection connection, Event event); static Optional<Snapshot> loadLatest(Connection connection); static Optional<Snapshot> loadBefore(Connection connection, Instant time); void save(Connection connection); static void deleteAfter(Connection connection, Snapshot snapshot);  }