@Test
public void readOpeningHoursTest() throws IOException {

    when(parser.readOpeningHours(reader)).thenCallRealMethod();
    when(reader.hasNext()).thenReturn(true, true, true, false);
    when(reader.nextName()).thenReturn("open_now", "periods", "skip");
    when(reader.nextBoolean()).thenReturn(true);
    List<OpenPeriod> periods = Collections.singletonList(new OpenPeriod(new DateTimePair("one", "two"), new DateTimePair("three", "four")));
    when(parser.readOpenPeriodsArray(reader)).thenReturn(periods);
    OpenHours expected = new OpenHours(true, periods);
    OpenHours actual = parser.readOpeningHours(reader);
    assertEquals(expected, actual);
}