### Question:
DataAccessAPIReader implements Reader { @Override public JSONArray read(int rows) throws ConnectorSDKException { List<JSONObject> data = processData(rows); JSONArray res = new JSONArray(); res.addAll(data); return res; } DataAccessAPIReader(
            CatalogService cs,
            DataAccessService das,
            DataWiringParam param,
            HttpClient httpClient,
            ParquetIOReader parquetIOReader,
            ReadAttributes readAttr
    ); @Override JSONArray read(int rows); @Override Integer getErrorRowCount(); @Override Boolean hasMoreData();  }### Answer:
@Test public void testReadOnce() throws ConnectorSDKException { dataAccessAPIReader = new DataAccessAPIReader(catService,das,param,httpClient, new ParquetIOImpl().getParquetIOReader(true), null); JSONArray array = dataAccessAPIReader.read(4); assert(array.size() == 4); }
@Test public void testReadMoreThanOnce() throws ConnectorSDKException { dataAccessAPIReader = new DataAccessAPIReader(catService,das,param,httpClient, new ParquetIOImpl().getParquetIOReader(true), null); JSONArray array = dataAccessAPIReader.read(5); JSONArray array1 = dataAccessAPIReader.read(5); assert(array.size() == 5); assert(array1.size() == 4); }
@Test public void testParquetProcessor() throws ConnectorSDKException { ParquetIOReader mockPIOReader = Mockito.mock(ParquetIOReader.class); DataWiringParam mockParam = new DataWiringParam("ParquetImsOrg", dataset); dataAccessAPIReader = new DataAccessAPIReader(catService,das,mockParam,httpClient, mockPIOReader,null); assert(dataAccessAPIReader.read(2).size()==0); }
@Test public void testReadOnceJSON() throws ConnectorSDKException { DataWiringParam mockParam = new DataWiringParam("JSONImsOrg", dataset); dataAccessAPIReader = new DataAccessAPIReader(catService,das,mockParam,httpClient, new ParquetIOImpl().getParquetIOReader(true), null); JSONArray array = dataAccessAPIReader.read(4); assert(array.size() == 4); }
@Test public void testReadMoreThanOnceJSON() throws ConnectorSDKException { DataWiringParam mockParam = new DataWiringParam("JSONImsOrg", dataset); dataAccessAPIReader = new DataAccessAPIReader(catService,das,mockParam,httpClient, new ParquetIOImpl().getParquetIOReader(true), null); JSONArray array = dataAccessAPIReader.read(4); assert(array.size() == 4); array = dataAccessAPIReader.read(1); assert(array.size() == 1); }