### Question:
TransactionalMessageServiceImpl implements TransactionalMessageService { @Override public PutMessageResult prepareMessage(MessageExtBrokerInner messageInner) { return transactionalMessageBridge.putHalfMessage(messageInner); } TransactionalMessageServiceImpl(TransactionalMessageBridge transactionBridge); @Override PutMessageResult prepareMessage(MessageExtBrokerInner messageInner); @Override void check(long transactionTimeout, int transactionCheckMax,
        AbstractTransactionalMessageCheckListener listener); @Override boolean deletePrepareMessage(MessageExt msgExt); @Override OperationResult commitMessage(EndTransactionRequestHeader requestHeader); @Override OperationResult rollbackMessage(EndTransactionRequestHeader requestHeader); @Override boolean open(); @Override void close();  }### Answer:
@Test public void testPrepareMessage() { MessageExtBrokerInner inner = createMessageBrokerInner(); when(bridge.putHalfMessage(any(MessageExtBrokerInner.class))).thenReturn(new PutMessageResult (PutMessageStatus.PUT_OK, new AppendMessageResult(AppendMessageStatus.PUT_OK))); PutMessageResult result = queueTransactionMsgService.prepareMessage(inner); assert result.isOk(); }