@Test public void shouldSearchForBusinessServiceDetails() { final List<Object> preparedStatementValues = new ArrayList<>(); final BusinessServiceDetailCriteria BusinessServiceDetailCriteria = Mockito.mock(BusinessServiceDetailCriteria.class); final String queryString = "testQuery"; when(businessServDetailQueryBuilder.prepareSearchQuery(BusinessServiceDetailCriteria, preparedStatementValues)).thenReturn(queryString); final List<BusinessServiceDetail> businessServiceDetailList = new ArrayList<>(); when(jdbcTemplate.query(queryString, preparedStatementValues.toArray(), businessServDetailRowMapper)) .thenReturn(businessServiceDetailList); assertTrue(businessServiceDetailList.equals(businessServiceDetailRepository.searchBusinessServiceDetails(BusinessServiceDetailCriteria))); }
public List<BusinessServiceDetail> searchBusinessServiceDetails(final BusinessServiceDetailCriteria businessServiceDetailCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = businessServDetailQueryBuilder.prepareSearchQuery(businessServiceDetailCriteria, preparedStatementValues); List<BusinessServiceDetail> businessServiceDetailList = new ArrayList<>(); try { logger.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); businessServiceDetailList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), businessServDetailRowMapper); logger.info("BusinessServiceDetailRepository businessServiceDetailList -> " + businessServiceDetailList); } catch (final Exception ex) { logger.info("the exception from searchBusinessServiceDetails : " + ex); } return businessServiceDetailList; }
BusinessServiceDetailRepository { public List<BusinessServiceDetail> searchBusinessServiceDetails(final BusinessServiceDetailCriteria businessServiceDetailCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = businessServDetailQueryBuilder.prepareSearchQuery(businessServiceDetailCriteria, preparedStatementValues); List<BusinessServiceDetail> businessServiceDetailList = new ArrayList<>(); try { logger.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); businessServiceDetailList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), businessServDetailRowMapper); logger.info("BusinessServiceDetailRepository businessServiceDetailList -> " + businessServiceDetailList); } catch (final Exception ex) { logger.info("the exception from searchBusinessServiceDetails : " + ex); } return businessServiceDetailList; } }
BusinessServiceDetailRepository { public List<BusinessServiceDetail> searchBusinessServiceDetails(final BusinessServiceDetailCriteria businessServiceDetailCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = businessServDetailQueryBuilder.prepareSearchQuery(businessServiceDetailCriteria, preparedStatementValues); List<BusinessServiceDetail> businessServiceDetailList = new ArrayList<>(); try { logger.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); businessServiceDetailList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), businessServDetailRowMapper); logger.info("BusinessServiceDetailRepository businessServiceDetailList -> " + businessServiceDetailList); } catch (final Exception ex) { logger.info("the exception from searchBusinessServiceDetails : " + ex); } return businessServiceDetailList; }  }
BusinessServiceDetailRepository { public List<BusinessServiceDetail> searchBusinessServiceDetails(final BusinessServiceDetailCriteria businessServiceDetailCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = businessServDetailQueryBuilder.prepareSearchQuery(businessServiceDetailCriteria, preparedStatementValues); List<BusinessServiceDetail> businessServiceDetailList = new ArrayList<>(); try { logger.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); businessServiceDetailList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), businessServDetailRowMapper); logger.info("BusinessServiceDetailRepository businessServiceDetailList -> " + businessServiceDetailList); } catch (final Exception ex) { logger.info("the exception from searchBusinessServiceDetails : " + ex); } return businessServiceDetailList; }  List<BusinessServiceDetail> searchBusinessServiceDetails(final BusinessServiceDetailCriteria businessServiceDetailCriteria); List<BusinessServiceDetail> getBussinessServiceDetail(RequestInfo requestInfo,BusinessServiceDetailCriteria BusinessServiceDetailsCriteria); List<BusinessServiceDetail> create(BusinessServiceDetailRequest businessServiceDetailRequest); List<BusinessServiceDetail> update(BusinessServiceDetailRequest businessServiceDetailRequest); boolean checkForDuplicates(List<BusinessServiceDetail> businessServiceDetailList, String mode); }
BusinessServiceDetailRepository { public List<BusinessServiceDetail> searchBusinessServiceDetails(final BusinessServiceDetailCriteria businessServiceDetailCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = businessServDetailQueryBuilder.prepareSearchQuery(businessServiceDetailCriteria, preparedStatementValues); List<BusinessServiceDetail> businessServiceDetailList = new ArrayList<>(); try { logger.info("queryStr -> " + queryStr + "preparedStatementValues -> " + preparedStatementValues.toString()); businessServiceDetailList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), businessServDetailRowMapper); logger.info("BusinessServiceDetailRepository businessServiceDetailList -> " + businessServiceDetailList); } catch (final Exception ex) { logger.info("the exception from searchBusinessServiceDetails : " + ex); } return businessServiceDetailList; }  List<BusinessServiceDetail> searchBusinessServiceDetails(final BusinessServiceDetailCriteria businessServiceDetailCriteria); List<BusinessServiceDetail> getBussinessServiceDetail(RequestInfo requestInfo,BusinessServiceDetailCriteria BusinessServiceDetailsCriteria); List<BusinessServiceDetail> create(BusinessServiceDetailRequest businessServiceDetailRequest); List<BusinessServiceDetail> update(BusinessServiceDetailRequest businessServiceDetailRequest); boolean checkForDuplicates(List<BusinessServiceDetail> businessServiceDetailList, String mode);  }