@Test public void test_getdepreciationSum() { final Map<Long, BigDecimal> expectedDepreciationSum = getDepreciationSumMap(); final String query = "select assetid,SUM(depreciationValue) AS totaldepreciationvalue FROM egasset_depreciation " + " where tenantid='ap.kurnool' group by assetid;"; when(depreciationQueryBuilder.getDepreciationSumQuery("ap.kurnool")).thenReturn(query); when(jdbcTemplate.query(any(String.class), any(DepreciationSumRowMapper.class))) .thenReturn(expectedDepreciationSum); final Map<Long, BigDecimal> actualDepreciationSum = depreciationRepository.getdepreciationSum("ap.kurnool"); assertEquals(expectedDepreciationSum.toString(), actualDepreciationSum.toString()); }
public Map<Long, BigDecimal> getdepreciationSum(final String tenantId) { final String sql = depreciationQueryBuilder.getDepreciationSumQuery(tenantId); return jdbcTemplate.query(sql, depreciationSumRowMapper); }
DepreciationRepository { public Map<Long, BigDecimal> getdepreciationSum(final String tenantId) { final String sql = depreciationQueryBuilder.getDepreciationSumQuery(tenantId); return jdbcTemplate.query(sql, depreciationSumRowMapper); } }
DepreciationRepository { public Map<Long, BigDecimal> getdepreciationSum(final String tenantId) { final String sql = depreciationQueryBuilder.getDepreciationSumQuery(tenantId); return jdbcTemplate.query(sql, depreciationSumRowMapper); }  }
DepreciationRepository { public Map<Long, BigDecimal> getdepreciationSum(final String tenantId) { final String sql = depreciationQueryBuilder.getDepreciationSumQuery(tenantId); return jdbcTemplate.query(sql, depreciationSumRowMapper); }  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 Map<Long, BigDecimal> getdepreciationSum(final String tenantId) { final String sql = depreciationQueryBuilder.getDepreciationSumQuery(tenantId); return jdbcTemplate.query(sql, depreciationSumRowMapper); }  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);  }