@Test
public void convert2Proto() {

    GlobalBeginResponse globalBeginResponse = new GlobalBeginResponse();
    globalBeginResponse.setResultCode(ResultCode.Failed);
    globalBeginResponse.setMsg("msg");
    globalBeginResponse.setExtraData("extraData");
    globalBeginResponse.setXid("xid");
    globalBeginResponse.setTransactionExceptionCode(TransactionExceptionCode.BranchRollbackFailed_Retriable);
    GlobalBeginResponseConvertor convertor = new GlobalBeginResponseConvertor();
    GlobalBeginResponseProto proto = convertor.convert2Proto(globalBeginResponse);
    GlobalBeginResponse real = convertor.convert2Model(proto);
    assertThat((real.getTypeCode())).isEqualTo(globalBeginResponse.getTypeCode());
    assertThat((real.getMsg())).isEqualTo(globalBeginResponse.getMsg());
    assertThat((real.getResultCode())).isEqualTo(globalBeginResponse.getResultCode());
    assertThat((real.getTransactionExceptionCode())).isEqualTo(globalBeginResponse.getTransactionExceptionCode());
}