@Test public void test_throwException_Push_To_Producer_WaterSource() { final List<SourceType> waterSourceList = new ArrayList<>(); waterSourceList.add(getWaterSourceType()); final SourceTypeRequest waterSourceRequest = new SourceTypeRequest(); waterSourceRequest.setSourceTypes(waterSourceList); assertTrue(waterSourceList.equals(waterSourceTypeService.pushCreateToQueue("topic", "key", waterSourceRequest))); }
public List<SourceType> pushCreateToQueue(final String topic, final String key, final SourceTypeRequest sourcetypeRequest) { for (final SourceType sourceType : sourcetypeRequest.getSourceTypes()) sourceType.setCode(codeGeneratorService.generate(SourceType.SEQ_WATERSOURCE)); try { kafkaTemplate.send(topic, key, sourcetypeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return sourcetypeRequest.getSourceTypes(); }
SourceTypeService { public List<SourceType> pushCreateToQueue(final String topic, final String key, final SourceTypeRequest sourcetypeRequest) { for (final SourceType sourceType : sourcetypeRequest.getSourceTypes()) sourceType.setCode(codeGeneratorService.generate(SourceType.SEQ_WATERSOURCE)); try { kafkaTemplate.send(topic, key, sourcetypeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return sourcetypeRequest.getSourceTypes(); } }
SourceTypeService { public List<SourceType> pushCreateToQueue(final String topic, final String key, final SourceTypeRequest sourcetypeRequest) { for (final SourceType sourceType : sourcetypeRequest.getSourceTypes()) sourceType.setCode(codeGeneratorService.generate(SourceType.SEQ_WATERSOURCE)); try { kafkaTemplate.send(topic, key, sourcetypeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return sourcetypeRequest.getSourceTypes(); }  }
SourceTypeService { public List<SourceType> pushCreateToQueue(final String topic, final String key, final SourceTypeRequest sourcetypeRequest) { for (final SourceType sourceType : sourcetypeRequest.getSourceTypes()) sourceType.setCode(codeGeneratorService.generate(SourceType.SEQ_WATERSOURCE)); try { kafkaTemplate.send(topic, key, sourcetypeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return sourcetypeRequest.getSourceTypes(); }  SourceTypeRequest create(final SourceTypeRequest waterSourceRequest); SourceTypeRequest update(final SourceTypeRequest waterSourceRequest); List<SourceType> pushCreateToQueue(final String topic, final String key,
            final SourceTypeRequest sourcetypeRequest); List<SourceType> pushUpdateToQueue(final String topic, final String key,
            final SourceTypeRequest sourcetypeRequest); boolean getWaterSourceByNameAndCode(final String code, final String name, final String tenantId); List<SourceType> getWaterSourceTypes(final SourceTypeGetRequest waterSourceTypeGetRequest); }
SourceTypeService { public List<SourceType> pushCreateToQueue(final String topic, final String key, final SourceTypeRequest sourcetypeRequest) { for (final SourceType sourceType : sourcetypeRequest.getSourceTypes()) sourceType.setCode(codeGeneratorService.generate(SourceType.SEQ_WATERSOURCE)); try { kafkaTemplate.send(topic, key, sourcetypeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return sourcetypeRequest.getSourceTypes(); }  SourceTypeRequest create(final SourceTypeRequest waterSourceRequest); SourceTypeRequest update(final SourceTypeRequest waterSourceRequest); List<SourceType> pushCreateToQueue(final String topic, final String key,
            final SourceTypeRequest sourcetypeRequest); List<SourceType> pushUpdateToQueue(final String topic, final String key,
            final SourceTypeRequest sourcetypeRequest); boolean getWaterSourceByNameAndCode(final String code, final String name, final String tenantId); List<SourceType> getWaterSourceTypes(final SourceTypeGetRequest waterSourceTypeGetRequest);  }