@Test public void test_Should_Update_DocumentType_NotNull() throws Exception { final DocumentTypeReq docTypeRequest = new DocumentTypeReq(); final RequestInfo requestInfo = new RequestInfo(); final User user = new User(); user.setId(1L); requestInfo.setUserInfo(user); final List<DocumentType> docTypeList = new ArrayList<>(); docTypeList.add(getDocumentType()); docTypeRequest.setRequestInfo(requestInfo); docTypeRequest.setDocumentTypes(docTypeList); final List<DocumentType> docTypeResult = docTypeService.pushCreateToQueue("topic", "key", docTypeRequest); assertNotNull(docTypeResult); }
public List<DocumentType> pushCreateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq) { for (final DocumentType documentType : documentTypeReq.getDocumentTypes()) documentType.setCode(codeGeneratorService.generate(DocumentType.SEQ_DOCUMENTTYPE)); try { kafkaTemplate.send(topic, key, documentTypeReq); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return documentTypeReq.getDocumentTypes(); }
DocumentTypeService { public List<DocumentType> pushCreateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq) { for (final DocumentType documentType : documentTypeReq.getDocumentTypes()) documentType.setCode(codeGeneratorService.generate(DocumentType.SEQ_DOCUMENTTYPE)); try { kafkaTemplate.send(topic, key, documentTypeReq); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return documentTypeReq.getDocumentTypes(); } }
DocumentTypeService { public List<DocumentType> pushCreateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq) { for (final DocumentType documentType : documentTypeReq.getDocumentTypes()) documentType.setCode(codeGeneratorService.generate(DocumentType.SEQ_DOCUMENTTYPE)); try { kafkaTemplate.send(topic, key, documentTypeReq); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return documentTypeReq.getDocumentTypes(); }  }
DocumentTypeService { public List<DocumentType> pushCreateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq) { for (final DocumentType documentType : documentTypeReq.getDocumentTypes()) documentType.setCode(codeGeneratorService.generate(DocumentType.SEQ_DOCUMENTTYPE)); try { kafkaTemplate.send(topic, key, documentTypeReq); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return documentTypeReq.getDocumentTypes(); }  DocumentTypeReq create(final DocumentTypeReq documentTypeReq); DocumentTypeReq update(final DocumentTypeReq documentTypeReq); List<DocumentType> pushCreateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq); List<DocumentType> pushUpdateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq); boolean getDocumentTypeByNameAndCode(final String code, final String name, final String tenantId); List<DocumentType> getDocumentTypes(final DocumentTypeGetReq documentTypeGetRequest); List<Long> getAllMandatoryDocs(final String applicationType); }
DocumentTypeService { public List<DocumentType> pushCreateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq) { for (final DocumentType documentType : documentTypeReq.getDocumentTypes()) documentType.setCode(codeGeneratorService.generate(DocumentType.SEQ_DOCUMENTTYPE)); try { kafkaTemplate.send(topic, key, documentTypeReq); } catch (final Exception ex) { log.error("Exception Encountered : " + ex); } return documentTypeReq.getDocumentTypes(); }  DocumentTypeReq create(final DocumentTypeReq documentTypeReq); DocumentTypeReq update(final DocumentTypeReq documentTypeReq); List<DocumentType> pushCreateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq); List<DocumentType> pushUpdateToQueue(final String topic, final String key, final DocumentTypeReq documentTypeReq); boolean getDocumentTypeByNameAndCode(final String code, final String name, final String tenantId); List<DocumentType> getDocumentTypes(final DocumentTypeGetReq documentTypeGetRequest); List<Long> getAllMandatoryDocs(final String applicationType);  }