@Test public void test_throwException_Push_To_Producer_Donation() { final List<Donation> donationList = new ArrayList<>(); donationList.add(getDonation()); final DonationRequest donationRequest = new DonationRequest(); donationRequest.setDonations(donationList); assertTrue(donationList.equals(donationService.pushCreateToQueue("", "", donationRequest))); }
public List<Donation> pushCreateToQueue(final String topic, final String key, final DonationRequest donationRequest) { for (final Donation donation : donationRequest.getDonations()) donation.setCode(codeGeneratorService.generate(Donation.SEQ_DONATION)); try { kafkaTemplate.send(topic, key, donationRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return donationRequest.getDonations(); }
DonationService { public List<Donation> pushCreateToQueue(final String topic, final String key, final DonationRequest donationRequest) { for (final Donation donation : donationRequest.getDonations()) donation.setCode(codeGeneratorService.generate(Donation.SEQ_DONATION)); try { kafkaTemplate.send(topic, key, donationRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return donationRequest.getDonations(); } }
DonationService { public List<Donation> pushCreateToQueue(final String topic, final String key, final DonationRequest donationRequest) { for (final Donation donation : donationRequest.getDonations()) donation.setCode(codeGeneratorService.generate(Donation.SEQ_DONATION)); try { kafkaTemplate.send(topic, key, donationRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return donationRequest.getDonations(); }  }
DonationService { public List<Donation> pushCreateToQueue(final String topic, final String key, final DonationRequest donationRequest) { for (final Donation donation : donationRequest.getDonations()) donation.setCode(codeGeneratorService.generate(Donation.SEQ_DONATION)); try { kafkaTemplate.send(topic, key, donationRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return donationRequest.getDonations(); }  DonationRequest create(final DonationRequest donationRequest); DonationRequest update(final DonationRequest donationRequest); List<Donation> pushCreateToQueue(final String topic, final String key, final DonationRequest donationRequest); List<Donation> pushUpdateToQueue(final String topic, final String key, final DonationRequest donationRequest); List<Donation> getDonationList(final DonationGetRequest donationGetRequest); boolean checkDonationsExist(final Donation donation); boolean checkPipeSizeExists(final Double pipeSize, final String tenantId); boolean checkUsageAndSubUsageExists(final String usageType, final String tenantId); }
DonationService { public List<Donation> pushCreateToQueue(final String topic, final String key, final DonationRequest donationRequest) { for (final Donation donation : donationRequest.getDonations()) donation.setCode(codeGeneratorService.generate(Donation.SEQ_DONATION)); try { kafkaTemplate.send(topic, key, donationRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return donationRequest.getDonations(); }  DonationRequest create(final DonationRequest donationRequest); DonationRequest update(final DonationRequest donationRequest); List<Donation> pushCreateToQueue(final String topic, final String key, final DonationRequest donationRequest); List<Donation> pushUpdateToQueue(final String topic, final String key, final DonationRequest donationRequest); List<Donation> getDonationList(final DonationGetRequest donationGetRequest); boolean checkDonationsExist(final Donation donation); boolean checkPipeSizeExists(final Double pipeSize, final String tenantId); boolean checkUsageAndSubUsageExists(final String usageType, final String tenantId);  }