@Test public void testCreateAsync() { GlCodeMaster glCodeMaster = getGlCodeMaster(); GlCodeMasterRequest glCodeMasterRequest = new GlCodeMasterRequest(); List<GlCodeMaster> glCodeMasters = new ArrayList<>(); glCodeMasters.add(glCodeMaster); glCodeMasterRequest.setGlCodeMasters(glCodeMasters); GlCodeMasterResponse glCodeMasterResponse = new GlCodeMasterResponse(); glCodeMasterResponse.setResponseInfo(null); glCodeMasterResponse.setGlCodeMasters(glCodeMasters); List<String> ids=new ArrayList<>(); ids.add("12"); when(applicationProperties.getGlCodeMasterseqName()).thenReturn("seq_egbs_glcodemaster"); when(sequenceGenService.getIds(glCodeMasters.size(),applicationProperties.getGlCodeMasterseqName())).thenReturn(ids); when(sequenceGenService.getIds(any(Integer.class),any(String.class))).thenReturn(ids); assertTrue(glCodeMasterResponse.equals(glCodeMasterService.createAsync(glCodeMasterRequest))); }
public GlCodeMasterResponse createAsync(GlCodeMasterRequest glCodeMasterRequest) { List<GlCodeMaster> glCodeMaster = glCodeMasterRequest.getGlCodeMasters(); List<String> glCodeMasterIds = sequenceGenService.getIds(glCodeMaster.size(), applicationProperties.getGlCodeMasterseqName()); int index=0; for (GlCodeMaster master: glCodeMaster) { master.setId(glCodeMasterIds.get(index++)); } logger.info("glCodeMasterRequest createAsync::" + glCodeMasterRequest); kafkaTemplate.send(applicationProperties.getCreateGlCodeMasterTopicName(), applicationProperties.getCreateGlCodeMasterTopicKey(), glCodeMasterRequest); return getGlCodeMasterResponse(glCodeMaster, glCodeMasterRequest.getRequestInfo()); }
GlCodeMasterService { public GlCodeMasterResponse createAsync(GlCodeMasterRequest glCodeMasterRequest) { List<GlCodeMaster> glCodeMaster = glCodeMasterRequest.getGlCodeMasters(); List<String> glCodeMasterIds = sequenceGenService.getIds(glCodeMaster.size(), applicationProperties.getGlCodeMasterseqName()); int index=0; for (GlCodeMaster master: glCodeMaster) { master.setId(glCodeMasterIds.get(index++)); } logger.info("glCodeMasterRequest createAsync::" + glCodeMasterRequest); kafkaTemplate.send(applicationProperties.getCreateGlCodeMasterTopicName(), applicationProperties.getCreateGlCodeMasterTopicKey(), glCodeMasterRequest); return getGlCodeMasterResponse(glCodeMaster, glCodeMasterRequest.getRequestInfo()); } }
GlCodeMasterService { public GlCodeMasterResponse createAsync(GlCodeMasterRequest glCodeMasterRequest) { List<GlCodeMaster> glCodeMaster = glCodeMasterRequest.getGlCodeMasters(); List<String> glCodeMasterIds = sequenceGenService.getIds(glCodeMaster.size(), applicationProperties.getGlCodeMasterseqName()); int index=0; for (GlCodeMaster master: glCodeMaster) { master.setId(glCodeMasterIds.get(index++)); } logger.info("glCodeMasterRequest createAsync::" + glCodeMasterRequest); kafkaTemplate.send(applicationProperties.getCreateGlCodeMasterTopicName(), applicationProperties.getCreateGlCodeMasterTopicKey(), glCodeMasterRequest); return getGlCodeMasterResponse(glCodeMaster, glCodeMasterRequest.getRequestInfo()); }  }
GlCodeMasterService { public GlCodeMasterResponse createAsync(GlCodeMasterRequest glCodeMasterRequest) { List<GlCodeMaster> glCodeMaster = glCodeMasterRequest.getGlCodeMasters(); List<String> glCodeMasterIds = sequenceGenService.getIds(glCodeMaster.size(), applicationProperties.getGlCodeMasterseqName()); int index=0; for (GlCodeMaster master: glCodeMaster) { master.setId(glCodeMasterIds.get(index++)); } logger.info("glCodeMasterRequest createAsync::" + glCodeMasterRequest); kafkaTemplate.send(applicationProperties.getCreateGlCodeMasterTopicName(), applicationProperties.getCreateGlCodeMasterTopicKey(), glCodeMasterRequest); return getGlCodeMasterResponse(glCodeMaster, glCodeMasterRequest.getRequestInfo()); }  GlCodeMasterResponse getGlCodes(GlCodeMasterCriteria searchGlCode, RequestInfo requestInfo); GlCodeMasterResponse create(GlCodeMasterRequest glCodeMasterRequest); GlCodeMasterResponse createAsync(GlCodeMasterRequest glCodeMasterRequest); GlCodeMasterResponse update(GlCodeMasterRequest request); GlCodeMasterResponse updateAsync(GlCodeMasterRequest request); }
GlCodeMasterService { public GlCodeMasterResponse createAsync(GlCodeMasterRequest glCodeMasterRequest) { List<GlCodeMaster> glCodeMaster = glCodeMasterRequest.getGlCodeMasters(); List<String> glCodeMasterIds = sequenceGenService.getIds(glCodeMaster.size(), applicationProperties.getGlCodeMasterseqName()); int index=0; for (GlCodeMaster master: glCodeMaster) { master.setId(glCodeMasterIds.get(index++)); } logger.info("glCodeMasterRequest createAsync::" + glCodeMasterRequest); kafkaTemplate.send(applicationProperties.getCreateGlCodeMasterTopicName(), applicationProperties.getCreateGlCodeMasterTopicKey(), glCodeMasterRequest); return getGlCodeMasterResponse(glCodeMaster, glCodeMasterRequest.getRequestInfo()); }  GlCodeMasterResponse getGlCodes(GlCodeMasterCriteria searchGlCode, RequestInfo requestInfo); GlCodeMasterResponse create(GlCodeMasterRequest glCodeMasterRequest); GlCodeMasterResponse createAsync(GlCodeMasterRequest glCodeMasterRequest); GlCodeMasterResponse update(GlCodeMasterRequest request); GlCodeMasterResponse updateAsync(GlCodeMasterRequest request);  }