@@ -0,0 +1,2114 @@
+package com.google.step.coffee.data;%0A%0Aimport com.google.step.coffee.TestHelper;%0Aimport com.google.step.coffee.entity.Event;%0Aimport com.google.step.coffee.entity.Group;%0Aimport org.junit.Test;%0A%0Aimport java.time.Duration;%0Aimport java.time.Instant;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.*;%0A%0Apublic class EventStoreTest extends TestHelper %7B%0A  private EventStore eventStore = new EventStore();%0A  private GroupStore groupStore = new GroupStore();%0A%0A  @Test%0A  public void testInsertSetsId() throws Exception %7B%0A    Group group = groupStore.create(%22test group%22);%0A%0A    Event event = Event.builder()%0A        .setDescription(%22bla bla bla%22)%0A        .setDuration(Duration.ofMinutes(30))%0A        .setStart(Instant.ofEpochSecond(1_600_000_000))%0A        .setGroupId(group.id())%0A        .build();%0A%0A    assertThat(eventStore.put(event).id(), notNullValue());%0A  %7D%0A%0A  @Test%0A  public void testFutureEventsReturned() throws Exception %7B%0A    Group group = groupStore.create(%22test group%22);%0A    Group anotherGroup = groupStore.create(%22unrelated group%22);%0A%0A    // round to the nearest second%0A    Instant now = Instant.ofEpochSecond(Instant.now().getEpochSecond());%0A%0A    Event eventPast = Event.builder()%0A        .setDescription(%22past%22)%0A        .setDuration(Duration.ofMinutes(30))%0A        .setStart(now.minusSeconds(100000))%0A        .setGroupId(group.id())%0A        .build();%0A%0A    Event eventFuture = Event.builder()%0A        .setDescription(%22future%22)%0A        .setDuration(Duration.ofMinutes(30))%0A        .setStart(now.plusSeconds(100000))%0A        .setGroupId(group.id())%0A        .build();%0A%0A    Event eventFutureOtherGroup = Event.builder()%0A        .setDescription(%22future other group%22)%0A        .setDuration(Duration.ofMinutes(30))%0A        .setStart(now.plusSeconds(100000))%0A        .setGroupId(anotherGroup.id())%0A        .build();%0A%0A    eventPast = eventStore.put(eventPast);%0A    eventFuture = eventStore.put(eventFuture);%0A    eventFutureOtherGroup = eventStore.put(eventFutureOtherGroup);%0A%0A    assertThat(eventStore.getUpcomingEventsForGroup(group), contains(%0A        eventFuture%0A    ));%0A  %7D%0A%7D%0A

Add tests for event store