	@Test
	public void testFlattenJsonOnNestedJsonGivingParentPath() throws Exception {


		// test to select some of the json elements by specifying their parent
		// paths
		// expected result is dataRecords for only the selected json elements
		// having column name with parent path i.e parentPath_colName

		TargetModel target = new HdfsTargetModel("test1", hdfsExplorer);

		List<DataRecord> result = JsonAdapter.flattenJson(dataRecord, nestedJson, target);

		// creating the expected data
		List<Map<String, String>> expectedColumnsList = new ArrayList<>();
		Map<String, String> colNameValuesMap = new HashMap<>();
		colNameValuesMap.put("fp", "2017-09");
		colNameValuesMap.put("SR1", "Y");
		colNameValuesMap.put("A" + PARENT_PATH_SEPARATOR + "B" + PARENT_PATH_SEPARATOR + "AB1", "AB1");
		colNameValuesMap.put("A" + PARENT_PATH_SEPARATOR + "B" + PARENT_PATH_SEPARATOR + "AB2", "AB2");
		colNameValuesMap.put(
				"A" + PARENT_PATH_SEPARATOR + "D" + PARENT_PATH_SEPARATOR + "E" + PARENT_PATH_SEPARATOR + "ADE", "ADE");
		expectedColumnsList.add(colNameValuesMap);

		Assert.assertTrue(compareResult(result, expectedColumnsList));

	}