### Question:
TransactionalMessageServiceImpl implements TransactionalMessageService { @Override public OperationResult commitMessage(EndTransactionRequestHeader requestHeader) { return getHalfMessageByOffset(requestHeader.getCommitLogOffset()); } 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 testCommitMessage() { when(bridge.lookMessageByOffset(anyLong())).thenReturn(createMessageBrokerInner()); OperationResult result = queueTransactionMsgService.commitMessage(createEndTransactionRequestHeader(MessageSysFlag.TRANSACTION_COMMIT_TYPE)); assertThat(result.getResponseCode()).isEqualTo(ResponseCode.SUCCESS); }