@Test public void testSerializeToJson_DefaultObject() throws Exception { Snapshot snapshot = Snapshot.builder(Instant.EPOCH, null) .withStartTime(Instant.EPOCH) .withEndTime(Instant.EPOCH) .build(); MatcherAssert.assertThat(objectMapper.writeValueAsString(snapshot), SameJSONAs.sameJSONAs("{snapshotTime:0,startTime:0,endTime:0,teamTagMap:{}," + "teamStates:{},publicTeamStates:{},statusMessage:\"\",status:NoResults,updateFrequency:3}")); }
public static Builder builder(Instant time, Snapshot other) { return new Builder(time, other); }
Snapshot { public static Builder builder(Instant time, Snapshot other) { return new Builder(time, other); } }
Snapshot { public static Builder builder(Instant time, Snapshot other) { return new Builder(time, other); } @SuppressWarnings("unused") private  Snapshot();  Snapshot(Instant time); }
Snapshot { public static Builder builder(Instant time, Snapshot other) { return new Builder(time, other); } @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 static Builder builder(Instant time, Snapshot other) { return new Builder(time, other); } @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);  }