@SuppressWarnings("unchecked") @Test public void test_get_depreciation_details() { final ArrayList<DepreciationDetail> depreciationDetails = new ArrayList<>(); when(depreciationQueryBuilder.getDepreciationSearchQuery(any(DepreciationCriteria.class), any(ArrayList.class))) .thenReturn(StringUtils.EMPTY); when(jdbcTemplate.query(any(String.class), any(Object[].class), any(DepreciationDetailRowMapper.class))) .thenReturn(depreciationDetails); assertTrue( depreciationDetails.equals(depreciationRepository.getDepreciationdetails(new DepreciationCriteria()))); }
public List<DepreciationDetail> getDepreciationdetails(final DepreciationCriteria depreciationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String sql = depreciationQueryBuilder.getDepreciationSearchQuery(depreciationCriteria, preparedStatementValues); return jdbcTemplate.query(sql, preparedStatementValues.toArray(), depreciationDetailRowMapper); }
DepreciationRepository { public List<DepreciationDetail> getDepreciationdetails(final DepreciationCriteria depreciationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String sql = depreciationQueryBuilder.getDepreciationSearchQuery(depreciationCriteria, preparedStatementValues); return jdbcTemplate.query(sql, preparedStatementValues.toArray(), depreciationDetailRowMapper); } }
DepreciationRepository { public List<DepreciationDetail> getDepreciationdetails(final DepreciationCriteria depreciationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String sql = depreciationQueryBuilder.getDepreciationSearchQuery(depreciationCriteria, preparedStatementValues); return jdbcTemplate.query(sql, preparedStatementValues.toArray(), depreciationDetailRowMapper); }  }
DepreciationRepository { public List<DepreciationDetail> getDepreciationdetails(final DepreciationCriteria depreciationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String sql = depreciationQueryBuilder.getDepreciationSearchQuery(depreciationCriteria, preparedStatementValues); return jdbcTemplate.query(sql, preparedStatementValues.toArray(), depreciationDetailRowMapper); }  List<DepreciationDetail> getDepreciationdetails(final DepreciationCriteria depreciationCriteria); void persistDepreciation(final Depreciation depreciation); Map<Long, BigDecimal> getdepreciationSum(final String tenantId); List<CalculationAssetDetails> getCalculationAssetDetails(final DepreciationCriteria depreciationCriteria); List<CalculationCurrentValue> getCalculationCurrentvalue(final DepreciationCriteria depreciationCriteria); List<DepreciationReportCriteria> getDepreciatedAsset(final DepreciationReportCriteria depreciationReportCriteria); List<DepreciationInputs> getDepreciationInputs(final DepreciationCriteria depreciationCriteria); }
DepreciationRepository { public List<DepreciationDetail> getDepreciationdetails(final DepreciationCriteria depreciationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String sql = depreciationQueryBuilder.getDepreciationSearchQuery(depreciationCriteria, preparedStatementValues); return jdbcTemplate.query(sql, preparedStatementValues.toArray(), depreciationDetailRowMapper); }  List<DepreciationDetail> getDepreciationdetails(final DepreciationCriteria depreciationCriteria); void persistDepreciation(final Depreciation depreciation); Map<Long, BigDecimal> getdepreciationSum(final String tenantId); List<CalculationAssetDetails> getCalculationAssetDetails(final DepreciationCriteria depreciationCriteria); List<CalculationCurrentValue> getCalculationCurrentvalue(final DepreciationCriteria depreciationCriteria); List<DepreciationReportCriteria> getDepreciatedAsset(final DepreciationReportCriteria depreciationReportCriteria); List<DepreciationInputs> getDepreciationInputs(final DepreciationCriteria depreciationCriteria);  }