@Test public void testFeeRowMapper() throws Exception { Mockito.when(rs.next()).thenReturn(true).thenReturn(false); when(rs.getString("id")).thenReturn("2"); when(rs.getString("tenantId")).thenReturn("ap.kurnool"); when(rs.getBigDecimal("fee")).thenReturn(BigDecimal.valueOf(10.1)); when(rs.getString("feeCriteria")).thenReturn("10.1"); when(rs.getLong("fromDate")).thenReturn(Long.valueOf("987456321")); when(rs.getLong("toDate")).thenReturn(Long.valueOf("987456321")); FeeRowMapper feeRowMapper = new FeeRowMapper(); Fee fee = feeRowMapper.mapRow(rs, 1); assertEquals(fee, getFee()); }
@Override public Fee mapRow(ResultSet rs, int rowNum) throws SQLException { Fee fee = new Fee(); fee.setId(rs.getString("id")); fee.setTenantId(rs.getString("tenantId")); fee.setFee(rs.getBigDecimal("fee")); fee.setFeeCriteria(rs.getString("feeCriteria")); fee.setFromDate(rs.getLong("fromDate")); fee.setToDate(rs.getLong("toDate")); return fee; }
FeeRowMapper implements RowMapper<Fee> { @Override public Fee mapRow(ResultSet rs, int rowNum) throws SQLException { Fee fee = new Fee(); fee.setId(rs.getString("id")); fee.setTenantId(rs.getString("tenantId")); fee.setFee(rs.getBigDecimal("fee")); fee.setFeeCriteria(rs.getString("feeCriteria")); fee.setFromDate(rs.getLong("fromDate")); fee.setToDate(rs.getLong("toDate")); return fee; } }
FeeRowMapper implements RowMapper<Fee> { @Override public Fee mapRow(ResultSet rs, int rowNum) throws SQLException { Fee fee = new Fee(); fee.setId(rs.getString("id")); fee.setTenantId(rs.getString("tenantId")); fee.setFee(rs.getBigDecimal("fee")); fee.setFeeCriteria(rs.getString("feeCriteria")); fee.setFromDate(rs.getLong("fromDate")); fee.setToDate(rs.getLong("toDate")); return fee; }  }
FeeRowMapper implements RowMapper<Fee> { @Override public Fee mapRow(ResultSet rs, int rowNum) throws SQLException { Fee fee = new Fee(); fee.setId(rs.getString("id")); fee.setTenantId(rs.getString("tenantId")); fee.setFee(rs.getBigDecimal("fee")); fee.setFeeCriteria(rs.getString("feeCriteria")); fee.setFromDate(rs.getLong("fromDate")); fee.setToDate(rs.getLong("toDate")); return fee; }  @Override Fee mapRow(ResultSet rs, int rowNum); }
FeeRowMapper implements RowMapper<Fee> { @Override public Fee mapRow(ResultSet rs, int rowNum) throws SQLException { Fee fee = new Fee(); fee.setId(rs.getString("id")); fee.setTenantId(rs.getString("tenantId")); fee.setFee(rs.getBigDecimal("fee")); fee.setFeeCriteria(rs.getString("feeCriteria")); fee.setFromDate(rs.getLong("fromDate")); fee.setToDate(rs.getLong("toDate")); return fee; }  @Override Fee mapRow(ResultSet rs, int rowNum);  }