### Question:
DataAccessSampleLogic { public List<EmpDto> getEmpAllRecord() { Connection con = null; Statement stmt = null; ResultSet rs = null; try { con = ds.getConnection(); stmt = con.createStatement(); rs = stmt.executeQuery("SELECT * FROM EMP"); List<EmpDto> list = new ArrayList<EmpDto>(); while (rs.next()) { EmpDto dto = new EmpDto(); dto.id = rs.getInt(1); dto.name = rs.getString(2); list.add(dto); } return list; } catch (Exception e) { throw new RuntimeException(e); } finally { try { if (rs != null) { rs.close(); } if (stmt != null) { stmt.close(); } if (con != null) { con.close(); } } catch (Exception ex) { throw new RuntimeException(ex); } } }  List<EmpDto> getEmpAllRecord(); void insertData(); public DataSource ds; public SampleLogic sampleLogic; }### Answer:
@Test public void testGetEmpAllRecord() throws Exception { List<EmpDto> actual = target.getEmpAllRecord(); assertEquals(10, actual.size()); }