@Test public void test_Should_Create_PipeSize() throws Exception { final PipeSizeRequest pipeSizeRequest = new PipeSizeRequest(); final RequestInfo requestInfo = new RequestInfo(); final User user = new User(); user.setId(1L); requestInfo.setUserInfo(user); final List<PipeSize> pipeSizeList = new ArrayList<>(); pipeSizeList.add(getPipeSize()); pipeSizeRequest.setRequestInfo(requestInfo); pipeSizeRequest.setPipeSizes(pipeSizeList); final List<PipeSize> pipeSizeResult = pipeSizeService.pushCreateToQueue("topic", "key", pipeSizeRequest); assertNotNull(pipeSizeResult); }
public List<PipeSize> pushCreateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest) { for (final PipeSize pipeSize : pipeSizeRequest.getPipeSizes()) { pipeSize.setCode(codeGeneratorService.generate(PipeSize.SEQ_PIPESIZE)); final double pipeSizeininch = pipeSize.getSizeInMilimeter() * 0.039370; pipeSize.setSizeInInch(Math.round(pipeSizeininch * 1000.0) / 1000.0); } try { kafkaTemplate.send(topic, key, pipeSizeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return pipeSizeRequest.getPipeSizes(); }
PipeSizeService { public List<PipeSize> pushCreateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest) { for (final PipeSize pipeSize : pipeSizeRequest.getPipeSizes()) { pipeSize.setCode(codeGeneratorService.generate(PipeSize.SEQ_PIPESIZE)); final double pipeSizeininch = pipeSize.getSizeInMilimeter() * 0.039370; pipeSize.setSizeInInch(Math.round(pipeSizeininch * 1000.0) / 1000.0); } try { kafkaTemplate.send(topic, key, pipeSizeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return pipeSizeRequest.getPipeSizes(); } }
PipeSizeService { public List<PipeSize> pushCreateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest) { for (final PipeSize pipeSize : pipeSizeRequest.getPipeSizes()) { pipeSize.setCode(codeGeneratorService.generate(PipeSize.SEQ_PIPESIZE)); final double pipeSizeininch = pipeSize.getSizeInMilimeter() * 0.039370; pipeSize.setSizeInInch(Math.round(pipeSizeininch * 1000.0) / 1000.0); } try { kafkaTemplate.send(topic, key, pipeSizeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return pipeSizeRequest.getPipeSizes(); }  }
PipeSizeService { public List<PipeSize> pushCreateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest) { for (final PipeSize pipeSize : pipeSizeRequest.getPipeSizes()) { pipeSize.setCode(codeGeneratorService.generate(PipeSize.SEQ_PIPESIZE)); final double pipeSizeininch = pipeSize.getSizeInMilimeter() * 0.039370; pipeSize.setSizeInInch(Math.round(pipeSizeininch * 1000.0) / 1000.0); } try { kafkaTemplate.send(topic, key, pipeSizeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return pipeSizeRequest.getPipeSizes(); }  PipeSizeRequest create(final PipeSizeRequest pipeSizeRequest); PipeSizeRequest update(final PipeSizeRequest pipeSizeRequest); List<PipeSize> pushCreateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest); List<PipeSize> pushUpdateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest); boolean getPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId); List<PipeSize> getPipeSizes(final PipeSizeGetRequest pipeSizeGetRequest); }
PipeSizeService { public List<PipeSize> pushCreateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest) { for (final PipeSize pipeSize : pipeSizeRequest.getPipeSizes()) { pipeSize.setCode(codeGeneratorService.generate(PipeSize.SEQ_PIPESIZE)); final double pipeSizeininch = pipeSize.getSizeInMilimeter() * 0.039370; pipeSize.setSizeInInch(Math.round(pipeSizeininch * 1000.0) / 1000.0); } try { kafkaTemplate.send(topic, key, pipeSizeRequest); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return pipeSizeRequest.getPipeSizes(); }  PipeSizeRequest create(final PipeSizeRequest pipeSizeRequest); PipeSizeRequest update(final PipeSizeRequest pipeSizeRequest); List<PipeSize> pushCreateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest); List<PipeSize> pushUpdateToQueue(final String topic, final String key, final PipeSizeRequest pipeSizeRequest); boolean getPipeSizeInmmAndCode(final String code, final Double sizeInMilimeter, final String tenantId); List<PipeSize> getPipeSizes(final PipeSizeGetRequest pipeSizeGetRequest);  }