@Test public void test_should_search_Revaluations() { final List<Revaluation> revaluations = new ArrayList<>(); final Revaluation revaluation = getRevaluationFromDB(); revaluations.add(revaluation); when(revaluationQueryBuilder.getQuery(any(RevaluationCriteria.class), any(List.class))) .thenReturn(StringUtils.EMPTY); when(jdbcTemplate.query(any(String.class), any(Object[].class), any(RevaluationRowMapper.class))) .thenReturn(revaluations); assertTrue(revaluations.equals(revaluationRepository.search(new RevaluationCriteria()))); }
public List<Revaluation> search(final RevaluationCriteria revaluationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = revaluationQueryBuilder.getQuery(revaluationCriteria, preparedStatementValues); List<Revaluation> revaluations = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); revaluations = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), revaluationRowMapper); log.info("RevaluationRepository::" + revaluations); } catch (final Exception ex) { log.info("the exception from findforcriteria : " + ex); throw new RuntimeException("the exception from find for Revaluation criteria :" + ex.getMessage()); } return revaluations; }
RevaluationRepository { public List<Revaluation> search(final RevaluationCriteria revaluationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = revaluationQueryBuilder.getQuery(revaluationCriteria, preparedStatementValues); List<Revaluation> revaluations = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); revaluations = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), revaluationRowMapper); log.info("RevaluationRepository::" + revaluations); } catch (final Exception ex) { log.info("the exception from findforcriteria : " + ex); throw new RuntimeException("the exception from find for Revaluation criteria :" + ex.getMessage()); } return revaluations; } }
RevaluationRepository { public List<Revaluation> search(final RevaluationCriteria revaluationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = revaluationQueryBuilder.getQuery(revaluationCriteria, preparedStatementValues); List<Revaluation> revaluations = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); revaluations = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), revaluationRowMapper); log.info("RevaluationRepository::" + revaluations); } catch (final Exception ex) { log.info("the exception from findforcriteria : " + ex); throw new RuntimeException("the exception from find for Revaluation criteria :" + ex.getMessage()); } return revaluations; }  }
RevaluationRepository { public List<Revaluation> search(final RevaluationCriteria revaluationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = revaluationQueryBuilder.getQuery(revaluationCriteria, preparedStatementValues); List<Revaluation> revaluations = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); revaluations = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), revaluationRowMapper); log.info("RevaluationRepository::" + revaluations); } catch (final Exception ex) { log.info("the exception from findforcriteria : " + ex); throw new RuntimeException("the exception from find for Revaluation criteria :" + ex.getMessage()); } return revaluations; }  void create(final RevaluationRequest revaluationRequest); String getRevaluationStatus(final AssetStatusObjectName objectName, final Status code,
            final String tenantId); List<Revaluation> search(final RevaluationCriteria revaluationCriteria); }
RevaluationRepository { public List<Revaluation> search(final RevaluationCriteria revaluationCriteria) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = revaluationQueryBuilder.getQuery(revaluationCriteria, preparedStatementValues); List<Revaluation> revaluations = null; try { log.info("queryStr::" + queryStr + "preparedStatementValues::" + preparedStatementValues.toString()); revaluations = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), revaluationRowMapper); log.info("RevaluationRepository::" + revaluations); } catch (final Exception ex) { log.info("the exception from findforcriteria : " + ex); throw new RuntimeException("the exception from find for Revaluation criteria :" + ex.getMessage()); } return revaluations; }  void create(final RevaluationRequest revaluationRequest); String getRevaluationStatus(final AssetStatusObjectName objectName, final Status code,
            final String tenantId); List<Revaluation> search(final RevaluationCriteria revaluationCriteria);  }