@Test public void testGetAutoFillPlantingDate_machakos_lastDate() throws IOException, Exception { log.debug("== testGetAutoFillPlantingDate_machakos_lastDate() == Start"); URL test_resource = this.getClass().getResource("/machakos_wth_only.json"); String line; String startDate = "01-15"; String endDate = "02-28"; String accRainAmt = "50.0"; String dayNum = "6"; String expected_1 = "19810228"; int expected_3 = 1; String acctual_1 = ""; int acctual_3 = 0; BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(test_resource.getPath()))); if ((line = br.readLine()) != null) { HashMap<String, Object> data = JSONAdapter.fromJSON(line); AcePathfinderUtil.insertValue(data, "crid", "MAZ"); data.put("sc_year", "1981"); HashMap<String, ArrayList<String>> results = ExperimentHelper.getAutoFillPlantingDate(data, startDate, endDate, accRainAmt, dayNum); acctual_1 = results.get("pdate").get(0); acctual_3 = results.get("pdate").size(); log.info("Results: {}", results); } assertEquals("getAutoFillPlantingDate: normal case", expected_1, acctual_1); assertEquals("getAutoFillPlantingDate: no date find case", expected_3, acctual_3); log.debug("== testGetAutoFillPlantingDate_machakos_lastDate() == End"); }