@Test public void test_should_create_meterStatus_and_push_to_queue() { when(codeGeneratorService.generate("SEQ_EGWTR_METERSTATUS")).thenReturn("1", "2"); when(applicationProperties.getCreateMeterStatusTopicName()).thenReturn("egov.wcms.meterstatus-create"); meterStatusRepository.pushCreateToQueue(getMeterStatusRequest()); verify(kafkaTemplate).send("egov.wcms.meterstatus-create", getMeterStatusRequestAfterCodeAppend()); }
public List<MeterStatus> pushCreateToQueue(final MeterStatusReq meterStatusReq) { logger.info("Sending MeterStatusRequest to queue"); final List<MeterStatus> meterStatuses = meterStatusReq.getMeterStatus(); for (final MeterStatus meterStatus : meterStatuses) meterStatus.setCode(codeGeneratorService.generate(MeterStatus.SEQ_METER_STATUS)); try { kafkaTemplate.send(applicationProperties.getCreateMeterStatusTopicName(), meterStatusReq); } catch (final Exception e) { logger.error("Exception encountered:" + e); } return meterStatusReq.getMeterStatus(); }
MeterStatusRepository { public List<MeterStatus> pushCreateToQueue(final MeterStatusReq meterStatusReq) { logger.info("Sending MeterStatusRequest to queue"); final List<MeterStatus> meterStatuses = meterStatusReq.getMeterStatus(); for (final MeterStatus meterStatus : meterStatuses) meterStatus.setCode(codeGeneratorService.generate(MeterStatus.SEQ_METER_STATUS)); try { kafkaTemplate.send(applicationProperties.getCreateMeterStatusTopicName(), meterStatusReq); } catch (final Exception e) { logger.error("Exception encountered:" + e); } return meterStatusReq.getMeterStatus(); } }
MeterStatusRepository { public List<MeterStatus> pushCreateToQueue(final MeterStatusReq meterStatusReq) { logger.info("Sending MeterStatusRequest to queue"); final List<MeterStatus> meterStatuses = meterStatusReq.getMeterStatus(); for (final MeterStatus meterStatus : meterStatuses) meterStatus.setCode(codeGeneratorService.generate(MeterStatus.SEQ_METER_STATUS)); try { kafkaTemplate.send(applicationProperties.getCreateMeterStatusTopicName(), meterStatusReq); } catch (final Exception e) { logger.error("Exception encountered:" + e); } return meterStatusReq.getMeterStatus(); }  }
MeterStatusRepository { public List<MeterStatus> pushCreateToQueue(final MeterStatusReq meterStatusReq) { logger.info("Sending MeterStatusRequest to queue"); final List<MeterStatus> meterStatuses = meterStatusReq.getMeterStatus(); for (final MeterStatus meterStatus : meterStatuses) meterStatus.setCode(codeGeneratorService.generate(MeterStatus.SEQ_METER_STATUS)); try { kafkaTemplate.send(applicationProperties.getCreateMeterStatusTopicName(), meterStatusReq); } catch (final Exception e) { logger.error("Exception encountered:" + e); } return meterStatusReq.getMeterStatus(); }  List<MeterStatus> pushCreateToQueue(final MeterStatusReq meterStatusReq); MeterStatusReq create(final MeterStatusReq meterStatusRequest); List<MeterStatus> pushUpdateToQueue(final MeterStatusReq meterStatusRequest); MeterStatusReq update(final MeterStatusReq meterStatusRequest); List<MeterStatus> getMeterStatusByCriteria(final MeterStatusGetRequest meterStatusGetRequest); }
MeterStatusRepository { public List<MeterStatus> pushCreateToQueue(final MeterStatusReq meterStatusReq) { logger.info("Sending MeterStatusRequest to queue"); final List<MeterStatus> meterStatuses = meterStatusReq.getMeterStatus(); for (final MeterStatus meterStatus : meterStatuses) meterStatus.setCode(codeGeneratorService.generate(MeterStatus.SEQ_METER_STATUS)); try { kafkaTemplate.send(applicationProperties.getCreateMeterStatusTopicName(), meterStatusReq); } catch (final Exception e) { logger.error("Exception encountered:" + e); } return meterStatusReq.getMeterStatus(); }  List<MeterStatus> pushCreateToQueue(final MeterStatusReq meterStatusReq); MeterStatusReq create(final MeterStatusReq meterStatusRequest); List<MeterStatus> pushUpdateToQueue(final MeterStatusReq meterStatusRequest); MeterStatusReq update(final MeterStatusReq meterStatusRequest); List<MeterStatus> getMeterStatusByCriteria(final MeterStatusGetRequest meterStatusGetRequest); static final Logger logger; }