WeatherService { @PostConstruct public void loadDefaultAirports() { log.debug("Loading initial airports"); try (InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(INITIAL_AIRPORTS_RESOURCE_NAME)) { if (is == null) { throw new WeatherException("Could not load initial airports: Could not open classpath resource: " + INITIAL_AIRPORTS_RESOURCE_NAME); } try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) { String line; while ( (line = br.readLine()) != null) { String[] split = line.split(","); createAirport(split[0], Double.valueOf(split[1]), Double.valueOf(split[2])); } } } catch (IOException e) { throw new WeatherException(e); } }  @PostConstruct void loadDefaultAirports(); void resetData(); void setDataPoint(String iataCode, DataPointType type, DataPoint dataPoint); Airport createAirport(String iataCode, double latitude, double longitude); List<Weather> searchAirportWeather(String iataCode, double radiusKm); Airport findAirport(String iataCode); double calculateHaversineDistance(Airport a1, Airport a2); Set<String> getAllIataCodes(); void deleteAirport(String iataCode); void createAirport(Airport airport);  }
@Test public void loadDefaultAirportsDoesNotCrash() throws IOException { target.loadDefaultAirports(); }