@Test public void getRentIncrementByIdTest() { List<RentIncrementType> rentIncrements = new ArrayList<>(); RentIncrementType rentIncrementType = new RentIncrementType(); rentIncrementType.setId(1l); Long rentId = 1l; rentIncrements.add(rentIncrementType); when(namedParameterJdbcTemplate.query(any(String.class), any(Map.class), Matchers.<BeanPropertyRowMapper>any())) .thenReturn(rentIncrements); assertTrue(rentIncrements.equals(rentIncrementRepository.getRentIncrementById(rentId))); }
public List<RentIncrementType> getRentIncrementById(Long rentID) { String rentIncrementTypeqQuery = AgreementQueryBuilder.RENT_INCREMENT_TYPE_QUERY; Map params = new HashMap(); params.put("rentId", rentID); List<RentIncrementType> rentIncrements = null; try { rentIncrements = namedParameterJdbcTemplate.query(rentIncrementTypeqQuery, params, new BeanPropertyRowMapper<>(RentIncrementType.class)); } catch (Exception e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage()); } return rentIncrements; }
RentIncrementRepository { public List<RentIncrementType> getRentIncrementById(Long rentID) { String rentIncrementTypeqQuery = AgreementQueryBuilder.RENT_INCREMENT_TYPE_QUERY; Map params = new HashMap(); params.put("rentId", rentID); List<RentIncrementType> rentIncrements = null; try { rentIncrements = namedParameterJdbcTemplate.query(rentIncrementTypeqQuery, params, new BeanPropertyRowMapper<>(RentIncrementType.class)); } catch (Exception e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage()); } return rentIncrements; } }
RentIncrementRepository { public List<RentIncrementType> getRentIncrementById(Long rentID) { String rentIncrementTypeqQuery = AgreementQueryBuilder.RENT_INCREMENT_TYPE_QUERY; Map params = new HashMap(); params.put("rentId", rentID); List<RentIncrementType> rentIncrements = null; try { rentIncrements = namedParameterJdbcTemplate.query(rentIncrementTypeqQuery, params, new BeanPropertyRowMapper<>(RentIncrementType.class)); } catch (Exception e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage()); } return rentIncrements; }  }
RentIncrementRepository { public List<RentIncrementType> getRentIncrementById(Long rentID) { String rentIncrementTypeqQuery = AgreementQueryBuilder.RENT_INCREMENT_TYPE_QUERY; Map params = new HashMap(); params.put("rentId", rentID); List<RentIncrementType> rentIncrements = null; try { rentIncrements = namedParameterJdbcTemplate.query(rentIncrementTypeqQuery, params, new BeanPropertyRowMapper<>(RentIncrementType.class)); } catch (Exception e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage()); } return rentIncrements; }  List<RentIncrementType> getRentIncrements(String tenantId, String basisOfAllotment); List<RentIncrementType> getRentIncrementById(Long rentID); }
RentIncrementRepository { public List<RentIncrementType> getRentIncrementById(Long rentID) { String rentIncrementTypeqQuery = AgreementQueryBuilder.RENT_INCREMENT_TYPE_QUERY; Map params = new HashMap(); params.put("rentId", rentID); List<RentIncrementType> rentIncrements = null; try { rentIncrements = namedParameterJdbcTemplate.query(rentIncrementTypeqQuery, params, new BeanPropertyRowMapper<>(RentIncrementType.class)); } catch (Exception e) { logger.info(e.getMessage(), e); throw new RuntimeException(e.getMessage()); } return rentIncrements; }  List<RentIncrementType> getRentIncrements(String tenantId, String basisOfAllotment); List<RentIncrementType> getRentIncrementById(Long rentID); static final Logger logger; }