@Test public void test_Should_Find_Donation_Valid() { final List<Object> preparedStatementValues = new ArrayList<>(); final DonationGetRequest donationRequest = getDonationvalidaRequest(); final String queryString = "MyQuery"; final List<Donation> donations = new ArrayList<>(); when(jdbcTemplate.query(queryString, preparedStatementValues.toArray(), donationRowMapper)) .thenReturn(donations); assertTrue(donations.equals(donationRepository.findForCriteria(donationRequest))); }
public List<Donation> findForCriteria(final DonationGetRequest donationRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = donationQueryBuilder.getQuery(donationRequest, preparedStatementValues); final List<Donation> donationList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), donationRowMapper); return donationList; }
DonationRepository { public List<Donation> findForCriteria(final DonationGetRequest donationRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = donationQueryBuilder.getQuery(donationRequest, preparedStatementValues); final List<Donation> donationList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), donationRowMapper); return donationList; } }
DonationRepository { public List<Donation> findForCriteria(final DonationGetRequest donationRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = donationQueryBuilder.getQuery(donationRequest, preparedStatementValues); final List<Donation> donationList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), donationRowMapper); return donationList; }  }
DonationRepository { public List<Donation> findForCriteria(final DonationGetRequest donationRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = donationQueryBuilder.getQuery(donationRequest, preparedStatementValues); final List<Donation> donationList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), donationRowMapper); return donationList; }  DonationRequest create(final DonationRequest donationRequest); DonationRequest update(final DonationRequest donationRequest); List<Donation> findForCriteria(final DonationGetRequest donationRequest); boolean checkDonationsExist(final String code, final String usageType,
            final String subUsageType, final Double maxPipeSize, final Double minPipeSize,
            final String tenantId); boolean checkPipeSizeExists(final Double pipeSize, final String tenantId); boolean checkUsageExists(final String usage, final String tenantId); }
DonationRepository { public List<Donation> findForCriteria(final DonationGetRequest donationRequest) { final List<Object> preparedStatementValues = new ArrayList<>(); final String queryStr = donationQueryBuilder.getQuery(donationRequest, preparedStatementValues); final List<Donation> donationList = jdbcTemplate.query(queryStr, preparedStatementValues.toArray(), donationRowMapper); return donationList; }  DonationRequest create(final DonationRequest donationRequest); DonationRequest update(final DonationRequest donationRequest); List<Donation> findForCriteria(final DonationGetRequest donationRequest); boolean checkDonationsExist(final String code, final String usageType,
            final String subUsageType, final Double maxPipeSize, final Double minPipeSize,
            final String tenantId); boolean checkPipeSizeExists(final Double pipeSize, final String tenantId); boolean checkUsageExists(final String usage, final String tenantId);  }