@Test
public void convert2Proto() {

    BranchRollbackRequest branchRegisterRequest = new BranchRollbackRequest();
    branchRegisterRequest.setApplicationData("data");
    branchRegisterRequest.setBranchType(BranchType.AT);
    branchRegisterRequest.setResourceId("resourceId");
    branchRegisterRequest.setXid("xid");
    branchRegisterRequest.setBranchId(123);
    BranchRollbackRequestConvertor convertor = new BranchRollbackRequestConvertor();
    BranchRollbackRequestProto proto = convertor.convert2Proto(
        branchRegisterRequest);
    BranchRollbackRequest real = convertor.convert2Model(proto);
    assertThat((real.getTypeCode())).isEqualTo(branchRegisterRequest.getTypeCode());
    assertThat((real.getApplicationData())).isEqualTo(branchRegisterRequest.getApplicationData());
    assertThat((real.getBranchType())).isEqualTo(branchRegisterRequest.getBranchType());
    assertThat((real.getXid())).isEqualTo(branchRegisterRequest.getXid());
    assertThat((real.getResourceId())).isEqualTo(branchRegisterRequest.getResourceId());
    assertThat((real.getBranchId())).isEqualTo(branchRegisterRequest.getBranchId());
}