@Test public void getAmilAvailDateTest() { when(rdsrepository.queryForString(anyString())).thenReturn("07-02-2018"); patchingRepositoryImpl.getAmilAvailDate(2018, 2); when(rdsrepository.queryForString(anyString())).thenThrow(new RuntimeException()); assertTrue(null== patchingRepositoryImpl.getAmilAvailDate(2018, 2)); }
@Override public String getAmilAvailDate(int year, int quarter) { try { String query = "select Date(createdDate) from cf_SystemConfiguration where keyname = 'pacman.kernel.compliance.map." + year + ".q" + quarter + "'"; return rdsrepository.queryForString(query); } catch (Exception e) { logger.error(e); return null; } }
PatchingRepositoryImpl implements PatchingRepository, Constants { @Override public String getAmilAvailDate(int year, int quarter) { try { String query = "select Date(createdDate) from cf_SystemConfiguration where keyname = 'pacman.kernel.compliance.map." + year + ".q" + quarter + "'"; return rdsrepository.queryForString(query); } catch (Exception e) { logger.error(e); return null; } } }
PatchingRepositoryImpl implements PatchingRepository, Constants { @Override public String getAmilAvailDate(int year, int quarter) { try { String query = "select Date(createdDate) from cf_SystemConfiguration where keyname = 'pacman.kernel.compliance.map." + year + ".q" + quarter + "'"; return rdsrepository.queryForString(query); } catch (Exception e) { logger.error(e); return null; } }  }
PatchingRepositoryImpl implements PatchingRepository, Constants { @Override public String getAmilAvailDate(int year, int quarter) { try { String query = "select Date(createdDate) from cf_SystemConfiguration where keyname = 'pacman.kernel.compliance.map." + year + ".q" + quarter + "'"; return rdsrepository.queryForString(query); } catch (Exception e) { logger.error(e); return null; } }  @Override List<Map<String, Object>> getPatchingProgress(String assetGroup,
            LocalDate startDate, LocalDate endDate); @Override List<Map<String, Object>> getIssueInfo(String assetGroup); List<Map<String, Object>> getClosedIssueInfo(String assetGroup,
            int size); @Override List<Map<String, Object>> getInstanceInfo(String assetGroup,
            Map<String, String> filters); @Override List<Map<String, Object>> getExecAndDirectorInfo(); @Override long getInstanceInfoCount(String assetGroup,
            Map<String, String> filters, String searchText); @Override String getAmilAvailDate(int year, int quarter); @Override int getPatchingWindow(); @Override Map<String, Long> getQuartersWithPatchingData(String assetGroup); Map<String, Object> addParentConditionPatching(String targetType); @Override List<Map<String, Object>> getOnpremIssueInfo(String assetGroup); @Override List<Map<String, Object>> getOnpremResourceInfo(String assetGroup,
            Map<String, String> filters); @Override Map<String, Object> getDirectorsAndExcutiveSponsers(String appTag,
            String appType); @Override Map<String, Long> getNonCompliantNumberForAgAndResourceType(
            String assetGroup, String resourceType); @Override List<Map<String, Object>> getPatchingPercentForDateRange(String assetGroup, LocalDate fromDate,
			LocalDate toDate); }
PatchingRepositoryImpl implements PatchingRepository, Constants { @Override public String getAmilAvailDate(int year, int quarter) { try { String query = "select Date(createdDate) from cf_SystemConfiguration where keyname = 'pacman.kernel.compliance.map." + year + ".q" + quarter + "'"; return rdsrepository.queryForString(query); } catch (Exception e) { logger.error(e); return null; } }  @Override List<Map<String, Object>> getPatchingProgress(String assetGroup,
            LocalDate startDate, LocalDate endDate); @Override List<Map<String, Object>> getIssueInfo(String assetGroup); List<Map<String, Object>> getClosedIssueInfo(String assetGroup,
            int size); @Override List<Map<String, Object>> getInstanceInfo(String assetGroup,
            Map<String, String> filters); @Override List<Map<String, Object>> getExecAndDirectorInfo(); @Override long getInstanceInfoCount(String assetGroup,
            Map<String, String> filters, String searchText); @Override String getAmilAvailDate(int year, int quarter); @Override int getPatchingWindow(); @Override Map<String, Long> getQuartersWithPatchingData(String assetGroup); Map<String, Object> addParentConditionPatching(String targetType); @Override List<Map<String, Object>> getOnpremIssueInfo(String assetGroup); @Override List<Map<String, Object>> getOnpremResourceInfo(String assetGroup,
            Map<String, String> filters); @Override Map<String, Object> getDirectorsAndExcutiveSponsers(String appTag,
            String appType); @Override Map<String, Long> getNonCompliantNumberForAgAndResourceType(
            String assetGroup, String resourceType); @Override List<Map<String, Object>> getPatchingPercentForDateRange(String assetGroup, LocalDate fromDate,
			LocalDate toDate);  }