@Test public void test_Inavalid_Find_WaterSource() throws Exception { final List<Object> preparedStatementValues = new ArrayList<>(); final List<SupplyType> supplyTypes = new ArrayList<>(); final SupplyType waterSource = getSupplyType(); supplyTypes.add(waterSource); final SupplyTypeGetRequest waterSourceGetRequest = Mockito.mock(SupplyTypeGetRequest.class); when(supplyTypeQueryBuilder.getQuery(waterSourceGetRequest, preparedStatementValues)).thenReturn(null); when(jdbcTemplate.query("query", preparedStatementValues.toArray(), supplyTypeRowMapper)) .thenReturn(supplyTypes); assertTrue(!supplyTypes.equals(supplyTypeRepository.findForCriteria(waterSourceGetRequest))); }
public List<SupplyType> findForCriteria(final SupplyTypeGetRequest supplyTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = supplyTypeQueryBuilder.getQuery(supplyTypeGetRequest, preparedStatementValues); return jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), supplyTypeRowMapper); }
SupplyTypeRepository { public List<SupplyType> findForCriteria(final SupplyTypeGetRequest supplyTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = supplyTypeQueryBuilder.getQuery(supplyTypeGetRequest, preparedStatementValues); return jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), supplyTypeRowMapper); } }
SupplyTypeRepository { public List<SupplyType> findForCriteria(final SupplyTypeGetRequest supplyTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = supplyTypeQueryBuilder.getQuery(supplyTypeGetRequest, preparedStatementValues); return jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), supplyTypeRowMapper); }  }
SupplyTypeRepository { public List<SupplyType> findForCriteria(final SupplyTypeGetRequest supplyTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = supplyTypeQueryBuilder.getQuery(supplyTypeGetRequest, preparedStatementValues); return jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), supplyTypeRowMapper); }  SupplyTypeRequest create(final SupplyTypeRequest supplyTypeRequest); SupplyTypeRequest update(final SupplyTypeRequest supplyTypeRequest); boolean checkSupplyTypeByNameAndCode(final String code, final String name, final String tenantId); List<SupplyType> findForCriteria(final SupplyTypeGetRequest supplyTypeGetRequest); }
SupplyTypeRepository { public List<SupplyType> findForCriteria(final SupplyTypeGetRequest supplyTypeGetRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = supplyTypeQueryBuilder.getQuery(supplyTypeGetRequest, preparedStatementValues); return jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), supplyTypeRowMapper); }  SupplyTypeRequest create(final SupplyTypeRequest supplyTypeRequest); SupplyTypeRequest update(final SupplyTypeRequest supplyTypeRequest); boolean checkSupplyTypeByNameAndCode(final String code, final String name, final String tenantId); List<SupplyType> findForCriteria(final SupplyTypeGetRequest supplyTypeGetRequest);  }