| 16 | import java.util.List; |
| 17 | |
| 18 | public class MockData { |
| 19 | |
| 20 | public static List<Person> getPeople() throws IOException { |
| 21 | InputStream inputStream = Resources.getResource("people.json").openStream(); |
| 22 | String json = IOUtils.toString(inputStream, StandardCharsets.UTF_8); |
| 23 | Type listType = new TypeToken<ArrayList<Person>>() { |
| 24 | }.getType(); |
| 25 | return new Gson().fromJson(json, listType); |
| 26 | } |
| 27 | |
| 28 | public static List<Car> getCars() throws IOException { |
| 29 | InputStream inputStream = Resources.getResource("cars.json").openStream(); |
| 30 | String json = IOUtils.toString(inputStream, StandardCharsets.UTF_8); |
| 31 | Type listType = new TypeToken<ArrayList<Car>>() { |
| 32 | }.getType(); |
| 33 | return new Gson().fromJson(json, listType); |
| 34 | } |
| 35 | |
| 36 | } |
nothing calls this directly
no outgoing calls
no test coverage detected