@Test public void test_Should_Search_WaterSource() { final List<SupplyType> supplyTypes = new ArrayList<>(); final SupplyType supplyType = getSupplyType(); supplyTypes.add(supplyType); when(supplyTypeQueryBuilder.getQuery(any(SupplyTypeGetRequest.class), any(List.class))).thenReturn(""); when(jdbcTemplate.query(any(String.class), any(Object[].class), any(SupplyTypeRowMapper.class))) .thenReturn(supplyTypes); assertTrue(supplyTypes.equals(supplyTypeRepository.findForCriteria(new SupplyTypeGetRequest()))); }
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);  }