@Test public void test_getCurrentValues() { final List<AssetCurrentValue> expectedAssetCurrentValues = getAssetCurrentValues(); final Set<Long> assetIds = new HashSet<Long>(); assetIds.add(Long.valueOf("2")); when(jdbcTemplate.query(any(String.class), any(CurrentValueRowMapper.class))) .thenReturn(expectedAssetCurrentValues); final List<AssetCurrentValue> actualAssetCurrentValues = currentValueRepository.getCurrentValues(assetIds, "ap.kurnool"); assertEquals(expectedAssetCurrentValues.toString(), actualAssetCurrentValues.toString()); }
public List<AssetCurrentValue> getCurrentValues(final Set<Long> assetIds, final String tenantId) { final String sql = currentValueQueryBuilder.getCurrentValueQuery(assetIds, tenantId); log.debug("the query for fetching currentValues : " + sql); return jdbcTemplate.query(sql, currentValueRowMapper); }
CurrentValueRepository { public List<AssetCurrentValue> getCurrentValues(final Set<Long> assetIds, final String tenantId) { final String sql = currentValueQueryBuilder.getCurrentValueQuery(assetIds, tenantId); log.debug("the query for fetching currentValues : " + sql); return jdbcTemplate.query(sql, currentValueRowMapper); } }
CurrentValueRepository { public List<AssetCurrentValue> getCurrentValues(final Set<Long> assetIds, final String tenantId) { final String sql = currentValueQueryBuilder.getCurrentValueQuery(assetIds, tenantId); log.debug("the query for fetching currentValues : " + sql); return jdbcTemplate.query(sql, currentValueRowMapper); }  }
CurrentValueRepository { public List<AssetCurrentValue> getCurrentValues(final Set<Long> assetIds, final String tenantId) { final String sql = currentValueQueryBuilder.getCurrentValueQuery(assetIds, tenantId); log.debug("the query for fetching currentValues : " + sql); return jdbcTemplate.query(sql, currentValueRowMapper); }  List<AssetCurrentValue> getCurrentValues(final Set<Long> assetIds, final String tenantId); void create(final List<AssetCurrentValue> assetCurrentValues); void update(final List<AssetCurrentValue> assetCurrentValues); }
CurrentValueRepository { public List<AssetCurrentValue> getCurrentValues(final Set<Long> assetIds, final String tenantId) { final String sql = currentValueQueryBuilder.getCurrentValueQuery(assetIds, tenantId); log.debug("the query for fetching currentValues : " + sql); return jdbcTemplate.query(sql, currentValueRowMapper); }  List<AssetCurrentValue> getCurrentValues(final Set<Long> assetIds, final String tenantId); void create(final List<AssetCurrentValue> assetCurrentValues); void update(final List<AssetCurrentValue> assetCurrentValues);  }