StopsFieldSetMapper implements GtfsFiledSetMapper<Stop> { @Override public Stop mapFieldSet(FieldSet fieldSet) throws BindException { Stop result = new Stop(); result.setStopId(fieldSet.readString("stop_id")); result.setStopName(fieldSet.readString("stop_name")); result.setStopLat(fieldSet.readString("stop_lat")); result.setStopLon(fieldSet.readString("stop_lon")); result.setStopCode(fieldSet.readString("platform_code")); result.setLocationType(Stop.LocationType.valueOfIndex(fieldSet.readInt("location_type"))); result.setParentStation(fieldSet.readString("parent_station")); return result; }  @Override Stop mapFieldSet(FieldSet fieldSet);  }
@Test public void testMapFieldSet() throws Exception { expect(fieldSetMock.readString("stop_id")).andReturn("stops:007015400"); expect(fieldSetMock.readString("stop_name")).andReturn("London Saint Pancras International"); expect(fieldSetMock.readString("stop_lat")).andReturn("51.5310399"); expect(fieldSetMock.readString("stop_lon")).andReturn("-0.1260606"); expect(fieldSetMock.readString("platform_code")).andReturn(""); expect(fieldSetMock.readInt("location_type")).andReturn(1); expect(fieldSetMock.readString("parent_station")).andReturn(""); replayAll(); Stop actual = mapper.mapFieldSet(fieldSetMock); Assert.assertNotNull(actual); verifyAll(); }