@Test
public void convert2Proto() {

    MergeResultMessage mergeResultMessage = new MergeResultMessage();
    AbstractResultMessage[] msgs = new AbstractResultMessage[1];
    final GlobalCommitResponse globalCommitResponse = new GlobalCommitResponse();
    globalCommitResponse.setGlobalStatus(GlobalStatus.AsyncCommitting);
    globalCommitResponse.setMsg("msg");
    globalCommitResponse.setResultCode(ResultCode.Failed);
    globalCommitResponse.setTransactionExceptionCode(TransactionExceptionCode.BranchRegisterFailed);
    msgs[0] = globalCommitResponse;
    mergeResultMessage.setMsgs(msgs);
    MergeResultMessageConvertor convertor = new MergeResultMessageConvertor();
    MergedResultMessageProto proto = convertor.convert2Proto(mergeResultMessage);
    MergeResultMessage real = convertor.convert2Model(proto);
    GlobalCommitResponse realObj = (GlobalCommitResponse)real.getMsgs()[0];
    assertThat((realObj.getTypeCode())).isEqualTo(globalCommitResponse.getTypeCode());
    assertThat((realObj.getMsg())).isEqualTo(globalCommitResponse.getMsg());
    assertThat((realObj.getResultCode())).isEqualTo(globalCommitResponse.getResultCode());
    assertThat((realObj.getTransactionExceptionCode())).isEqualTo(
        globalCommitResponse.getTransactionExceptionCode());
}