@Test public void testFindForCriteria() { when(marriageCertQueryBuilder.getQuery(any(MarriageCertCriteria.class), any(List.class))) .thenReturn(getQueryForFFC()); when(jdbcTemplate.query(any(String.class), Matchers.<Object[]>any(), any(MarriageCertRowMapper.class))) .thenReturn(getReissueCertApplication()); List<ReissueCertAppl> reissueCertAppls = marriageCertRepository.findForCriteria(getMarriageCertCriteria()); assertEquals(getReissueCertApplication(), reissueCertAppls); }
public List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria) { log.info("MarriageCertRepository marriageCertCriteria:::" + marriageCertCriteria.getTenantId()); List<Object> preparedStatementValues = new ArrayList<Object>(); log.info("MarriageCertRepository preparedStatementValues:::" + preparedStatementValues); String queryStr = marriageCertQueryBuilder.getQuery(marriageCertCriteria, preparedStatementValues); log.info("queryStr;;"+queryStr); List<ReissueCertAppl> marriageCert = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), marriageCertRowMapper); return marriageCert; }
MarriageCertRepository { public List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria) { log.info("MarriageCertRepository marriageCertCriteria:::" + marriageCertCriteria.getTenantId()); List<Object> preparedStatementValues = new ArrayList<Object>(); log.info("MarriageCertRepository preparedStatementValues:::" + preparedStatementValues); String queryStr = marriageCertQueryBuilder.getQuery(marriageCertCriteria, preparedStatementValues); log.info("queryStr;;"+queryStr); List<ReissueCertAppl> marriageCert = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), marriageCertRowMapper); return marriageCert; } }
MarriageCertRepository { public List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria) { log.info("MarriageCertRepository marriageCertCriteria:::" + marriageCertCriteria.getTenantId()); List<Object> preparedStatementValues = new ArrayList<Object>(); log.info("MarriageCertRepository preparedStatementValues:::" + preparedStatementValues); String queryStr = marriageCertQueryBuilder.getQuery(marriageCertCriteria, preparedStatementValues); log.info("queryStr;;"+queryStr); List<ReissueCertAppl> marriageCert = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), marriageCertRowMapper); return marriageCert; }  }
MarriageCertRepository { public List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria) { log.info("MarriageCertRepository marriageCertCriteria:::" + marriageCertCriteria.getTenantId()); List<Object> preparedStatementValues = new ArrayList<Object>(); log.info("MarriageCertRepository preparedStatementValues:::" + preparedStatementValues); String queryStr = marriageCertQueryBuilder.getQuery(marriageCertCriteria, preparedStatementValues); log.info("queryStr;;"+queryStr); List<ReissueCertAppl> marriageCert = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), marriageCertRowMapper); return marriageCert; }  void insert(MarriageRegn marriageRegn); List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria); void createDoc(ReissueCertRequest reissueAppRequest); void updateDoc(ReissueCertRequest reissueAppRequest); void createReissue(ReissueCertRequest reissueAppRequest); void updateReissue(ReissueCertRequest reissueAppRequest); void createCert(ReissueCertAppl reissueApp); }
MarriageCertRepository { public List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria) { log.info("MarriageCertRepository marriageCertCriteria:::" + marriageCertCriteria.getTenantId()); List<Object> preparedStatementValues = new ArrayList<Object>(); log.info("MarriageCertRepository preparedStatementValues:::" + preparedStatementValues); String queryStr = marriageCertQueryBuilder.getQuery(marriageCertCriteria, preparedStatementValues); log.info("queryStr;;"+queryStr); List<ReissueCertAppl> marriageCert = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), marriageCertRowMapper); return marriageCert; }  void insert(MarriageRegn marriageRegn); List<ReissueCertAppl> findForCriteria(MarriageCertCriteria marriageCertCriteria); void createDoc(ReissueCertRequest reissueAppRequest); void updateDoc(ReissueCertRequest reissueAppRequest); void createReissue(ReissueCertRequest reissueAppRequest); void updateReissue(ReissueCertRequest reissueAppRequest); void createCert(ReissueCertAppl reissueApp); static final String CERTIFICATE_INSERT_QUERY; final String GET_APPLICATION_NO_QUERY; final String create_Certificate_Query; }