MessageFactory { public static Message newOrderTransferPaymentMessage(Long orderId, Long orgOrderId, String bizType, String objectType) { Message msg = new Message(orderId, "ORD_ORDER", Constant.EVENT_TYPE.ORDER_TRANSFER_PAYMENT.name()); if (null != orderId && null != orgOrderId && null != bizType && null != objectType) { msg.setAddition(new StringBuilder().append(orderId.toString()) .append(",").append(orgOrderId.toString()).append(",") .append(bizType).append(",").append(objectType).toString()); } return msg; }  static Message newCertSmsSendMessage(Long orderId, String mobile); static Message newTravelGroupStatus(Long travelGroupId,String status); static Message newTravelGroupWordAble(Long travelGroupId); static Message newOrderCreateMessage(Long orderId); static Message newOrderCancelMessage(Long orderId); static Message newSupplierOrderCancelMessage(Long orderId); static Message newOrderGroupWordStatus(Long orderId); static Message newOrderCancelMessage(Long orderId,String addition); static Message newOrderApproveMessage(Long orderId); static Message newOrderResourceMessage(Long orderId); static Message newOrderApproveBeforePrepayMessage(Long orderId); static Message newOrderPerformMessage(Long orderId); static Message newOrderPaymentMessage(Long orderId); static Message newPaymentSuccAndOrderApproveWait(Long orderId); static Message newOrderPay0YuanMessage(Long orderId); static Message newOrderFinishMessage(Long orderId); static Message newOrderRestoreMessage(Long orderId); static Message newOrderPartpayPaymentMessage(Long orderId); static Message newOrderEContractConfirmed(Long orderId); static Message newOrderSendEContract(Long orderId); static Message newOrderContactUpdateAgreeItem(Long orderId,boolean agree3,boolean agree4 ,boolean agree5,boolean agree6); static Message newCouponUsedMessage(Long orderId); static Message newCreateFaxTask(Long orderId); static Message newProductCreateMessage(Long productId); static Message newProductBranchOnOffLineMessage(Long productId, Long prodBranchId); static Message newProductUpdateMessage(Long productId); static Message newProductUpdateEbkMessage(Long productId); static Message newProductPlaceUpdateMessage(Long productId); static Message newDistribuionProductDeleteMessage(Long branchId,String distriburorIds); static Message newDistribuionCashBackUpdateMessage(Long productId); static Message newPolicyRequestMessage(Long policyId); static Message newPolicyCancelMessage(Long policyId); static Message newProductSellPriceMessage(Long prodBranchId); static Message newProductOnOffMessage(Long productId); static Message newProductChangeProductItemMessage(Long productId); static Message newPasscodeApplySuccessMessage(Long codeId,String provider); static Message newPasscodeDestroyMessage(Long codeId, String addtion); static Message newPassportUsedMessage(Long codeId, String addtion); static Message newPasscodeApplyFailedMessage(Long codeId); static Message newCashAccountDrawMoneyMessage(Long moneyDrawId); static Message newCashAccountRefundmentMessage(Long moneyDrawId); static Message newCashAccountRechargeMessage(Long cashRechargeId); static Message newCashAccountPayMessage(Long cashPayId); static Message newPasscodeApplyMessage(Long codeId); static Message newPasscodeEventMessage(Long codeId); static Message newOrderTravellerPersonModifyEventMessage(Long codeId); static Message newForPaymentReceiverMsg(String mobile,String code); static Message newPaymentSuccessCallMessage(Long paymentId); static Message newRefundSuccessCallMessage(Long refundmentId); static Message newPaymentRefundmentMessage(Long objectId); static Message newPaymentQueryMessage(Long objectId); static Message newEmailMessage(Long emailId); static Message newGroupAdviceNoteMailMessage(Long orderId,String operator); static Message newOrderSendRefreshEContract(Long orderId); static Message newProductBranchItemChangeMessage(Long prodBranchId); static Message newProductBranchEditMessage(Long prodBranchId); static Message newProductMetaPriceMessage(Long metaBranchId,final String addition); static Message newAboradHotelCashAccountRefundmentMessage(Long refundmentId); static Message newOrderTransferPaymentMessage(Long orderId, Long orgOrderId, String bizType, String objectType); static Message newSetOrderItemMetaMessage(final String settlementStatus,final List<?> orderItemMetaIds,final String operatorName); static Message newModifySettlementPricesMessage(List<?> orderItemMetaIds,String operatorName); static Message newModifyTotalSettlementPricesMessage(List<?> orderItemMetaIds,String operatorName); static Message newModifyOrderTravellerPersonMessage(Long orderId); static Message newOrderRefundedSuccessMessage(Long refundmentId); static Message newOrderSettleRepair(final Long ObjectId,final String objectType); static Message newOrderItemMetaSettle(final Long ObjectId,final String operatorName); static Message newLuceneCreateMessage(LUCENE_INDEX_TYPE type); static Message newLuceneUpdateMessage(LUCENE_INDEX_TYPE type,Long... ojbectId); static Message updateProdBranchValidTimeMessage(final Long ObjectId,final String addition); static Message orderActivatedOrdMessage(final Long orderId, final List<Long> orderItemMetaIds); static Message orderCancelActivatedOrdMessage(final Long orderId, final List<Long> orderItemMetaIds); static Message newTrafficIssueRefundMessage(final Long orderItemMetaId); static Message newTrainCancelRefundMessage(final Long orderItemMetaId,final String billNo); static Message newSupplierChannelReSubmit(final Long orderId); static Message newSupplierChannelReCancel(final Long orderId); static Message newSupplierChannelRePay(final Long orderId); static Message newTrainRefundSuccessMessage(final Long orderTrafficRefundId); static Message newMetaProductUpdateMessage(Long metaProductId, String addition); static Message newMetaProductTypeByRouteUpdateMessage(Long metaProductId); static Message newTntOrderRefundMessage(Long orderId);  }
@Test public void newOrderTransferPaymentMessageTest() { Long orderId = 12L; Long orgOrderId = 123L; String bizType = "SUPER_ORDER"; String objectType = "ORD_ORDER"; Message message = MessageFactory.newOrderTransferPaymentMessage(orderId, orgOrderId, bizType, objectType); Assert.assertNotNull(message); Assert.assertEquals(orderId, (Long) message.getObjectId()); Assert.assertEquals("ORD_ORDER", message.getObjectType()); Assert.assertEquals(Constant.EVENT_TYPE.ORDER_TRANSFER_PAYMENT.name(), message.getEventType()); Assert.assertEquals(orderId + "," + orgOrderId + "," + bizType + "," + objectType, message.getAddition()); message = MessageFactory.newOrderTransferPaymentMessage(orderId, null, bizType, objectType); Assert.assertNotNull(message); Assert.assertNull(message.getAddition()); message = MessageFactory.newOrderTransferPaymentMessage(orderId, orgOrderId, null, objectType); Assert.assertNotNull(message); Assert.assertNull(message.getAddition()); message = MessageFactory.newOrderTransferPaymentMessage(orderId, orgOrderId, bizType, null); Assert.assertNotNull(message); Assert.assertNull(message.getAddition()); }