@Test public void shouldSearchForTaxPeriods() { final List<Object> preparedStatementValues = new ArrayList<>(); final TaxPeriodCriteria taxPeriodCriteria = Mockito.mock(TaxPeriodCriteria.class); final String queryString = "testQuery"; when(taxPeriodQueryBuilder.prepareSearchQuery(taxPeriodCriteria, preparedStatementValues)).thenReturn(queryString); final List<TaxPeriod> taxPeriods = new ArrayList<>(); when(jdbcTemplate.query(queryString, preparedStatementValues.toArray(), taxPeriodRowMapper)) .thenReturn(taxPeriods); assertTrue(taxPeriods.equals(taxPeriodRepository.searchTaxPeriods(taxPeriodCriteria))); }
public List<TaxPeriod> searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = taxPeriodQueryBuilder.prepareSearchQuery(taxPeriodCriteria, preparedStatementValues); List<TaxPeriod> taxPeriods = new ArrayList<>(); try { log.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); taxPeriods = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), taxPeriodRowMapper); log.info("TaxPeriodRepository taxPeriods -> " + taxPeriods); } catch (final Exception ex) { log.info("the exception from searchTaxPeriods : " + ex); } return taxPeriods; }
TaxPeriodRepository { public List<TaxPeriod> searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = taxPeriodQueryBuilder.prepareSearchQuery(taxPeriodCriteria, preparedStatementValues); List<TaxPeriod> taxPeriods = new ArrayList<>(); try { log.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); taxPeriods = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), taxPeriodRowMapper); log.info("TaxPeriodRepository taxPeriods -> " + taxPeriods); } catch (final Exception ex) { log.info("the exception from searchTaxPeriods : " + ex); } return taxPeriods; } }
TaxPeriodRepository { public List<TaxPeriod> searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = taxPeriodQueryBuilder.prepareSearchQuery(taxPeriodCriteria, preparedStatementValues); List<TaxPeriod> taxPeriods = new ArrayList<>(); try { log.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); taxPeriods = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), taxPeriodRowMapper); log.info("TaxPeriodRepository taxPeriods -> " + taxPeriods); } catch (final Exception ex) { log.info("the exception from searchTaxPeriods : " + ex); } return taxPeriods; }  }
TaxPeriodRepository { public List<TaxPeriod> searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = taxPeriodQueryBuilder.prepareSearchQuery(taxPeriodCriteria, preparedStatementValues); List<TaxPeriod> taxPeriods = new ArrayList<>(); try { log.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); taxPeriods = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), taxPeriodRowMapper); log.info("TaxPeriodRepository taxPeriods -> " + taxPeriods); } catch (final Exception ex) { log.info("the exception from searchTaxPeriods : " + ex); } return taxPeriods; }  List<TaxPeriod> searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria); List<TaxPeriod> getTaxPeriod(RequestInfo requestInfo,TaxPeriodCriteria taxPeriodCriteria); List<TaxPeriod> create(TaxPeriodRequest taxPeriodRequest); List<TaxPeriod> update(TaxPeriodRequest taxPeriodRequest); boolean checkForDuplicates(List<TaxPeriod> taxPeriodList, String mode); }
TaxPeriodRepository { public List<TaxPeriod> searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = taxPeriodQueryBuilder.prepareSearchQuery(taxPeriodCriteria, preparedStatementValues); List<TaxPeriod> taxPeriods = new ArrayList<>(); try { log.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); taxPeriods = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), taxPeriodRowMapper); log.info("TaxPeriodRepository taxPeriods -> " + taxPeriods); } catch (final Exception ex) { log.info("the exception from searchTaxPeriods : " + ex); } return taxPeriods; }  List<TaxPeriod> searchTaxPeriods(final TaxPeriodCriteria taxPeriodCriteria); List<TaxPeriod> getTaxPeriod(RequestInfo requestInfo,TaxPeriodCriteria taxPeriodCriteria); List<TaxPeriod> create(TaxPeriodRequest taxPeriodRequest); List<TaxPeriod> update(TaxPeriodRequest taxPeriodRequest); boolean checkForDuplicates(List<TaxPeriod> taxPeriodList, String mode);  }