SessionData { static List<SessionData> from(final Schedule schedule, OffsetTime now, ZoneId zoneId) { return from(schedule.getSlots(), now, zoneId); } private  SessionData(final ScheduleSlot slot); static List<SessionData> from(List<ScheduleSlot> slots, OffsetTime now, ZoneId zoneId); @Override String toString(); final String room; final List<String> speakers; final String title; final String beginTime; final String endTime; final boolean isNotAllocated; final String roomSetup; final List<SpeakerReference> speakerObjects; }
@Test public void testFrom1035OnMonday() throws IOException { System.out.println("from"); URL jsonFile = this.getClass().getResource("/Devoxx2017BeMonday.json"); try (InputStream inputStream = jsonFile.openStream()) { Schedule schedule = JsonDataConverter.convertFromInputStream(inputStream, Schedule.class); List<SessionData> result = SessionData.from(schedule, OffsetTime.parse("10:35Z"), ZoneId.systemDefault()); assertEquals(6, result.size()); } }
@Test public void testFrom1300OnMonday() throws IOException { System.out.println("from"); URL jsonFile = this.getClass().getResource("/Devoxx2017BeMonday.json"); try (InputStream inputStream = jsonFile.openStream()) { Schedule schedule = JsonDataConverter.convertFromInputStream(inputStream, Schedule.class); List<SessionData> result = SessionData.from(schedule, OffsetTime.parse("13:00Z"), ZoneId.systemDefault()); assertEquals(7, result.size()); } }