### Question:
ProcessDefinitionDao { public Map<Integer,String> queryAllProcessDefinition(Connection conn){ Map<Integer,String> processDefinitionJsonMap = new HashMap<>(); String sql = String.format("SELECT id,process_definition_json FROM t_ds_process_definition"); ResultSet rs = null; PreparedStatement pstmt = null; try { pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); while (rs.next()){ Integer id = rs.getInt(1); String processDefinitionJson = rs.getString(2); processDefinitionJsonMap.put(id,processDefinitionJson); } } catch (Exception e) { logger.error(e.getMessage(),e); throw new RuntimeException("sql: " + sql, e); } finally { ConnectionUtils.releaseResource(rs, pstmt, conn); } return processDefinitionJsonMap; }  Map<Integer,String> queryAllProcessDefinition(Connection conn); void updateProcessDefinitionJson(Connection conn,Map<Integer,String> processDefinitionJsonMap); static final Logger logger; }### Answer:
@Test public void testQueryAllProcessDefinition() throws Exception{ Map<Integer, String> processDefinitionJsonMap = processDefinitionDao.queryAllProcessDefinition(dataSource.getConnection()); assertThat(processDefinitionJsonMap.size(),greaterThanOrEqualTo(0)); }
@Test(expected = Exception.class) public void testQueryAllProcessDefinitionException() throws Exception{ processDefinitionDao.queryAllProcessDefinition(null); }