CalendarDatesFieldSetMapper implements GtfsFiledSetMapper<CalendarDate> { @Override public CalendarDate mapFieldSet(FieldSet fieldSet) throws BindException { CalendarDate result = new CalendarDate(); result.setDate(GtfsFiledSetMapper.readDate(fieldSet, "date")); result.setServiceId(fieldSet.readString("service_id")); result.setExceptionType(CalendarDate.ExceptionType.valueOfIndex(fieldSet.readInt("exception_type"))); return result; }  @Override CalendarDate mapFieldSet(FieldSet fieldSet);  }
@Test public void testMapFieldSet() throws Exception { expect(fieldSetMock.readDate("date", GtfsFiledSetMapper.DATE_FORMAT)).andReturn(new Date()); expect(fieldSetMock.readString("service_id")).andReturn("1"); expect(fieldSetMock.readInt("exception_type")).andReturn(0); replayAll(); CalendarDate actual = mapper.mapFieldSet(fieldSetMock); Assert.assertNotNull(actual); verifyAll(); }