@Test public void getProjectionDetailsFromDbTest() throws Exception { List<Map<String, Object>> projectionsByWeek = new ArrayList<>(); Map<String, Object> projections = new HashMap<>(); projections.put("week", 1); projections.put("projection", 100l); projections.put("week", 2); projections.put("projection", 400l); projectionsByWeek.add(projections); when(rdsRepository.getDataFromPacman(anyString())).thenReturn(projectionsByWeek); projectionRepositoryImpl.getProjectionDetailsFromDb("onpremserver", 2018, 2); }
@Override public List<Map<String, Object>> getProjectionDetailsFromDb(String targetType, int year, int quarter) throws DataException { String query = "select week,projection from pac_v2_projections where resourceType = '" + targetType + "' AND year = '" + year + "' AND quarter = '" + quarter + "' "; return rdsRepository.getDataFromPacman(query); }
ProjectionRepositoryImpl implements ProjectionRepository, Constants { @Override public List<Map<String, Object>> getProjectionDetailsFromDb(String targetType, int year, int quarter) throws DataException { String query = "select week,projection from pac_v2_projections where resourceType = '" + targetType + "' AND year = '" + year + "' AND quarter = '" + quarter + "' "; return rdsRepository.getDataFromPacman(query); } }
ProjectionRepositoryImpl implements ProjectionRepository, Constants { @Override public List<Map<String, Object>> getProjectionDetailsFromDb(String targetType, int year, int quarter) throws DataException { String query = "select week,projection from pac_v2_projections where resourceType = '" + targetType + "' AND year = '" + year + "' AND quarter = '" + quarter + "' "; return rdsRepository.getDataFromPacman(query); }  }
ProjectionRepositoryImpl implements ProjectionRepository, Constants { @Override public List<Map<String, Object>> getProjectionDetailsFromDb(String targetType, int year, int quarter) throws DataException { String query = "select week,projection from pac_v2_projections where resourceType = '" + targetType + "' AND year = '" + year + "' AND quarter = '" + quarter + "' "; return rdsRepository.getDataFromPacman(query); }  @Override Boolean updateProjectionByTargetType(ProjectionRequest projectionRequest); @Override List<Map<String, Object>> getProjectionDetailsFromDb(String targetType, int year, int quarter); @Override Long getTotalAssetCountByTargetType(String targetType); List<LocalDate> getListOfLastWeekDateOfQuarter(); int getWeekNoByDate(LocalDate date); @Override Map<Integer, Long> getPatchingSnapshot(String assetGroup); Map<String, Long> getUnPatchedDetailsByApplication(String assetGroup, String resourceType); Map<String, Long> getAssetDetailsByApplication(String assetGroup, String resourceType); Long getAssetCountByAg(String assetGroup, String resourceType); @SuppressWarnings("deprecation") List<Map<String, Object>> getAppsDetails(String appType); }
ProjectionRepositoryImpl implements ProjectionRepository, Constants { @Override public List<Map<String, Object>> getProjectionDetailsFromDb(String targetType, int year, int quarter) throws DataException { String query = "select week,projection from pac_v2_projections where resourceType = '" + targetType + "' AND year = '" + year + "' AND quarter = '" + quarter + "' "; return rdsRepository.getDataFromPacman(query); }  @Override Boolean updateProjectionByTargetType(ProjectionRequest projectionRequest); @Override List<Map<String, Object>> getProjectionDetailsFromDb(String targetType, int year, int quarter); @Override Long getTotalAssetCountByTargetType(String targetType); List<LocalDate> getListOfLastWeekDateOfQuarter(); int getWeekNoByDate(LocalDate date); @Override Map<Integer, Long> getPatchingSnapshot(String assetGroup); Map<String, Long> getUnPatchedDetailsByApplication(String assetGroup, String resourceType); Map<String, Long> getAssetDetailsByApplication(String assetGroup, String resourceType); Long getAssetCountByAg(String assetGroup, String resourceType); @SuppressWarnings("deprecation") List<Map<String, Object>> getAppsDetails(String appType);  }