@Test public void test() { Map<String, List<String>> value = new HashMap<>(); List<String> values = new ArrayList<>(); values.add("value1"); value.put("key1", values); when(serviceConfigurationQueryBuilder.getSelectQuery(any(ServiceConfigurationSearchCriteria.class), any(List.class))).thenReturn("select * from table"); when(jdbcTemplate.query(any(String.class), Matchers.<Object[]>any(), any(ServiceConfigurationKeyValuesRowMapper.class))).thenReturn(value); List<Integer> ids = new ArrayList<>(); ids.add(Integer.valueOf("2")); ids.add(Integer.valueOf("6")); ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria = new ServiceConfigurationSearchCriteria(); serviceConfigurationSearchCriteria.setIds(ids); serviceConfigurationSearchCriteria.setEffectiveFrom(Long.valueOf("246812648")); serviceConfigurationSearchCriteria.setName("service1"); serviceConfigurationSearchCriteria.setTenantId("ap.kurnool"); serviceConfigurationRepository.findForCriteria(serviceConfigurationSearchCriteria); }
public Map<String, List<String>> findForCriteria( ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria) { List<Object> preparedStatementValues = new ArrayList<Object>(); String query = serviceConfigurationQueryBuilder.getSelectQuery(serviceConfigurationSearchCriteria, preparedStatementValues); log.info("ServiceConfigurationRepository query: " + query); log.info("preparedStatementValues : " + preparedStatementValues); Map<String, List<String>> hrConfigurationKeyValues = jdbcTemplate.query(query, preparedStatementValues.toArray(), serviceConfigurationKeyValuesRowMapper); return hrConfigurationKeyValues; }
ServiceConfigurationRepository { public Map<String, List<String>> findForCriteria( ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria) { List<Object> preparedStatementValues = new ArrayList<Object>(); String query = serviceConfigurationQueryBuilder.getSelectQuery(serviceConfigurationSearchCriteria, preparedStatementValues); log.info("ServiceConfigurationRepository query: " + query); log.info("preparedStatementValues : " + preparedStatementValues); Map<String, List<String>> hrConfigurationKeyValues = jdbcTemplate.query(query, preparedStatementValues.toArray(), serviceConfigurationKeyValuesRowMapper); return hrConfigurationKeyValues; } }
ServiceConfigurationRepository { public Map<String, List<String>> findForCriteria( ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria) { List<Object> preparedStatementValues = new ArrayList<Object>(); String query = serviceConfigurationQueryBuilder.getSelectQuery(serviceConfigurationSearchCriteria, preparedStatementValues); log.info("ServiceConfigurationRepository query: " + query); log.info("preparedStatementValues : " + preparedStatementValues); Map<String, List<String>> hrConfigurationKeyValues = jdbcTemplate.query(query, preparedStatementValues.toArray(), serviceConfigurationKeyValuesRowMapper); return hrConfigurationKeyValues; }  }
ServiceConfigurationRepository { public Map<String, List<String>> findForCriteria( ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria) { List<Object> preparedStatementValues = new ArrayList<Object>(); String query = serviceConfigurationQueryBuilder.getSelectQuery(serviceConfigurationSearchCriteria, preparedStatementValues); log.info("ServiceConfigurationRepository query: " + query); log.info("preparedStatementValues : " + preparedStatementValues); Map<String, List<String>> hrConfigurationKeyValues = jdbcTemplate.query(query, preparedStatementValues.toArray(), serviceConfigurationKeyValuesRowMapper); return hrConfigurationKeyValues; }  Map<String, List<String>> findForCriteria(
			ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria); }
ServiceConfigurationRepository { public Map<String, List<String>> findForCriteria( ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria) { List<Object> preparedStatementValues = new ArrayList<Object>(); String query = serviceConfigurationQueryBuilder.getSelectQuery(serviceConfigurationSearchCriteria, preparedStatementValues); log.info("ServiceConfigurationRepository query: " + query); log.info("preparedStatementValues : " + preparedStatementValues); Map<String, List<String>> hrConfigurationKeyValues = jdbcTemplate.query(query, preparedStatementValues.toArray(), serviceConfigurationKeyValuesRowMapper); return hrConfigurationKeyValues; }  Map<String, List<String>> findForCriteria(
			ServiceConfigurationSearchCriteria serviceConfigurationSearchCriteria);  }