@Test
public void convert2Proto() {

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