@Test public void test_Should_Search_WaterSource() { final List<SourceType> waterSourceTypes = new ArrayList<>(); final SourceType waterSource = getWaterSourceType(); waterSourceTypes.add(waterSource); when(waterSourceTypeQueryBuilder.getQuery(any(SourceTypeGetRequest.class), any(List.class))).thenReturn(""); when(jdbcTemplate.query(any(String.class), any(Object[].class), any(SourceTypeRowMapper.class))) .thenReturn(waterSourceTypes); assertTrue(waterSourceTypes.equals(waterSourceTypeRepository.findForCriteria(new SourceTypeGetRequest()))); }
public List<SourceType> findForCriteria(final SourceTypeGetRequest sourceTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = sourceTypeQueryBuilder.getQuery(sourceTypeGetRequest, preparedStatementValues); final List<SourceType> waterSourceTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), sourceTypeRowMapper); return waterSourceTypes; }
SourceTypeRepository { public List<SourceType> findForCriteria(final SourceTypeGetRequest sourceTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = sourceTypeQueryBuilder.getQuery(sourceTypeGetRequest, preparedStatementValues); final List<SourceType> waterSourceTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), sourceTypeRowMapper); return waterSourceTypes; } }
SourceTypeRepository { public List<SourceType> findForCriteria(final SourceTypeGetRequest sourceTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = sourceTypeQueryBuilder.getQuery(sourceTypeGetRequest, preparedStatementValues); final List<SourceType> waterSourceTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), sourceTypeRowMapper); return waterSourceTypes; }  }
SourceTypeRepository { public List<SourceType> findForCriteria(final SourceTypeGetRequest sourceTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = sourceTypeQueryBuilder.getQuery(sourceTypeGetRequest, preparedStatementValues); final List<SourceType> waterSourceTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), sourceTypeRowMapper); return waterSourceTypes; }  SourceTypeRequest create(final SourceTypeRequest sourceTypeRequest); SourceTypeRequest update(final SourceTypeRequest sourceTypeRequest); boolean checkWaterSourceTypeByNameAndCode(final String code, final String name, final String tenantId); List<SourceType> findForCriteria(final SourceTypeGetRequest sourceTypeGetRequest); }
SourceTypeRepository { public List<SourceType> findForCriteria(final SourceTypeGetRequest sourceTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = sourceTypeQueryBuilder.getQuery(sourceTypeGetRequest, preparedStatementValues); final List<SourceType> waterSourceTypes = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), sourceTypeRowMapper); return waterSourceTypes; }  SourceTypeRequest create(final SourceTypeRequest sourceTypeRequest); SourceTypeRequest update(final SourceTypeRequest sourceTypeRequest); boolean checkWaterSourceTypeByNameAndCode(final String code, final String name, final String tenantId); List<SourceType> findForCriteria(final SourceTypeGetRequest sourceTypeGetRequest);  }