ScrapeConfig { public int getPort() { return port; } ScrapeConfig();  ScrapeConfig(int port, String url); int getPort(); String getUrl(); void setPort(int port); void setUrl(String url); void setQueries(List<Map<String, Object>> queries); List<Map<String, Object>> getQueries(); void build();  }
@Test public void testReadConfig() { JSONReader reader = null; try { reader = new JSONReader(new FileReader("src/test/resources/.metrics_scrape_config")); reader.startArray(); List<ScrapeConfig> configs = new ArrayList<ScrapeConfig>(); while(reader.hasNext()) { ScrapeConfig config = reader.readObject(ScrapeConfig.class); configs.add(config); } reader.endArray(); reader.close(); Assert.assertEquals(8006, configs.get(0).getPort()); Assert.assertEquals(8007, configs.get(1).getPort()); } catch (FileNotFoundException e) { Assert.fail("Error reading config file"); } }