@Test public void test_Inavalid_Find_WaterSource() throws Exception { final List<Object> preparedStatementValues = new ArrayList<>(); final List<SourceType> waterSourceTypes = new ArrayList<>(); final SourceType waterSource = getWaterSourceType(); waterSourceTypes.add(waterSource); final SourceTypeGetRequest waterSourceGetRequest = Mockito.mock(SourceTypeGetRequest.class); when(waterSourceTypeQueryBuilder.getQuery(waterSourceGetRequest, preparedStatementValues)).thenReturn(null); when(jdbcTemplate.query("query", preparedStatementValues.toArray(), waterSourceTypeRowMapper)) .thenReturn(waterSourceTypes); assertTrue(!waterSourceTypes.equals(waterSourceTypeRepository.findForCriteria(waterSourceGetRequest))); }
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);  }