@Test
public void convert2Proto() {

    BranchCommitResponse branchCommitResponse = new BranchCommitResponse();
    branchCommitResponse.setTransactionExceptionCode(TransactionExceptionCode.BranchTransactionNotExist);
    branchCommitResponse.setResultCode(ResultCode.Success);
    branchCommitResponse.setMsg("xx");
    branchCommitResponse.setXid("xid");
    branchCommitResponse.setBranchStatus(BranchStatus.PhaseTwo_Rollbacked);
    branchCommitResponse.setBranchId(123);
    BranchCommitResponseConvertor convertor = new BranchCommitResponseConvertor();
    BranchCommitResponseProto proto = convertor.convert2Proto(branchCommitResponse);
    BranchCommitResponse real = convertor.convert2Model(proto);
    assertThat(real.getTypeCode()).isEqualTo(branchCommitResponse.getTypeCode());
    assertThat(real.getMsg()).isEqualTo(branchCommitResponse.getMsg());
    assertThat(real.getXid()).isEqualTo(branchCommitResponse.getXid());
    assertThat(real.getTransactionExceptionCode()).isEqualTo(branchCommitResponse.getTransactionExceptionCode());
    assertThat(real.getBranchStatus()).isEqualTo(branchCommitResponse.getBranchStatus());
    assertThat(real.getResultCode()).isEqualTo(branchCommitResponse.getResultCode());
}