@Test public void test_Should_Update_ReceivingCenterType_NotNull() throws Exception { final ReceivingCenterTypeReq receivingCenterTypeRequest = new ReceivingCenterTypeReq(); final RequestInfo requestInfo = new RequestInfo(); final User user = new User(); user.setId(1L); requestInfo.setUserInfo(user); final ReceivingCenterType receivingCenterType = new ReceivingCenterType(); final AuditDetails auditDetails = new AuditDetails(); receivingCenterType.setAuditDetails(auditDetails); receivingCenterType.setCode("10"); receivingCenterType.setActive(true); receivingCenterType.getAuditDetails().setCreatedBy(1L); receivingCenterType.setName("test name"); receivingCenterType.setDescription("test description"); receivingCenterTypeRequest.setRequestInfo(requestInfo); receivingCenterTypeRequest.setCenterType(receivingCenterType); final ReceivingCenterType receivingCenterTypeResult = receivingCenterTypeService.sendMessage("topic", "key", receivingCenterTypeRequest); assertNotNull(receivingCenterTypeResult); }
public ReceivingCenterType sendMessage(String topic, String key, final ReceivingCenterTypeReq centerTypeRequest) { final ObjectMapper mapper = new ObjectMapper(); String receivingCenterValue = null; try { logger.info("createReceivingCenterType Request::" + centerTypeRequest); receivingCenterValue = mapper.writeValueAsString(centerTypeRequest); logger.info("createReceivingCenterType::" + receivingCenterValue); } catch (final JsonProcessingException e) { e.printStackTrace(); } try { pgrProducer.sendMessage(topic, key, receivingCenterValue); } catch (final Exception ex) { logger.error("Exception Encountered : " + ex); } return centerTypeRequest.getCenterType(); }
ReceivingCenterTypeService { public ReceivingCenterType sendMessage(String topic, String key, final ReceivingCenterTypeReq centerTypeRequest) { final ObjectMapper mapper = new ObjectMapper(); String receivingCenterValue = null; try { logger.info("createReceivingCenterType Request::" + centerTypeRequest); receivingCenterValue = mapper.writeValueAsString(centerTypeRequest); logger.info("createReceivingCenterType::" + receivingCenterValue); } catch (final JsonProcessingException e) { e.printStackTrace(); } try { pgrProducer.sendMessage(topic, key, receivingCenterValue); } catch (final Exception ex) { logger.error("Exception Encountered : " + ex); } return centerTypeRequest.getCenterType(); } }
ReceivingCenterTypeService { public ReceivingCenterType sendMessage(String topic, String key, final ReceivingCenterTypeReq centerTypeRequest) { final ObjectMapper mapper = new ObjectMapper(); String receivingCenterValue = null; try { logger.info("createReceivingCenterType Request::" + centerTypeRequest); receivingCenterValue = mapper.writeValueAsString(centerTypeRequest); logger.info("createReceivingCenterType::" + receivingCenterValue); } catch (final JsonProcessingException e) { e.printStackTrace(); } try { pgrProducer.sendMessage(topic, key, receivingCenterValue); } catch (final Exception ex) { logger.error("Exception Encountered : " + ex); } return centerTypeRequest.getCenterType(); }  }
ReceivingCenterTypeService { public ReceivingCenterType sendMessage(String topic, String key, final ReceivingCenterTypeReq centerTypeRequest) { final ObjectMapper mapper = new ObjectMapper(); String receivingCenterValue = null; try { logger.info("createReceivingCenterType Request::" + centerTypeRequest); receivingCenterValue = mapper.writeValueAsString(centerTypeRequest); logger.info("createReceivingCenterType::" + receivingCenterValue); } catch (final JsonProcessingException e) { e.printStackTrace(); } try { pgrProducer.sendMessage(topic, key, receivingCenterValue); } catch (final Exception ex) { logger.error("Exception Encountered : " + ex); } return centerTypeRequest.getCenterType(); }  ReceivingCenterTypeReq create(final ReceivingCenterTypeReq centerTypeReq); ReceivingCenterTypeReq update(final ReceivingCenterTypeReq centerTypeReq); List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest); boolean checkReceivingCenterTypeByCode(final String code, final String tenantId); boolean checkReceivingCenterNameExists(ReceivingCenterType receivingCenter, String mode); boolean checkReceivingCenterCodeName(final String code, final String name, final String tenantId, final String mode); ReceivingCenterType sendMessage(String topic, String key, final ReceivingCenterTypeReq centerTypeRequest); }
ReceivingCenterTypeService { public ReceivingCenterType sendMessage(String topic, String key, final ReceivingCenterTypeReq centerTypeRequest) { final ObjectMapper mapper = new ObjectMapper(); String receivingCenterValue = null; try { logger.info("createReceivingCenterType Request::" + centerTypeRequest); receivingCenterValue = mapper.writeValueAsString(centerTypeRequest); logger.info("createReceivingCenterType::" + receivingCenterValue); } catch (final JsonProcessingException e) { e.printStackTrace(); } try { pgrProducer.sendMessage(topic, key, receivingCenterValue); } catch (final Exception ex) { logger.error("Exception Encountered : " + ex); } return centerTypeRequest.getCenterType(); }  ReceivingCenterTypeReq create(final ReceivingCenterTypeReq centerTypeReq); ReceivingCenterTypeReq update(final ReceivingCenterTypeReq centerTypeReq); List<ReceivingCenterType> getAllReceivingCenterTypes(final ReceivingCenterTypeGetReq centerTypeGetRequest); boolean checkReceivingCenterTypeByCode(final String code, final String tenantId); boolean checkReceivingCenterNameExists(ReceivingCenterType receivingCenter, String mode); boolean checkReceivingCenterCodeName(final String code, final String name, final String tenantId, final String mode); ReceivingCenterType sendMessage(String topic, String key, final ReceivingCenterTypeReq centerTypeRequest); static final Logger logger; }