@Test
public void convert2Proto() {

    BranchCommitRequest branchCommitRequest = new BranchCommitRequest();
    branchCommitRequest.setBranchType(BranchType.AT);
    branchCommitRequest.setXid("xid");
    branchCommitRequest.setResourceId("resourceId");
    branchCommitRequest.setBranchId(123);
    branchCommitRequest.setApplicationData("app");
    BranchCommitRequestConvertor branchCommitRequestConvertor = new BranchCommitRequestConvertor();
    BranchCommitRequestProto proto = branchCommitRequestConvertor.convert2Proto(
        branchCommitRequest);
    BranchCommitRequest realRequest = branchCommitRequestConvertor.convert2Model(proto);
    assertThat(realRequest.getTypeCode()).isEqualTo(branchCommitRequest.getTypeCode());
    assertThat(realRequest.getBranchType()).isEqualTo(branchCommitRequest.getBranchType());
    assertThat(realRequest.getXid()).isEqualTo(branchCommitRequest.getXid());
    assertThat(realRequest.getResourceId()).isEqualTo(branchCommitRequest.getResourceId());
    assertThat(realRequest.getBranchId()).isEqualTo(branchCommitRequest.getBranchId());
    assertThat(realRequest.getApplicationData()).isEqualTo(branchCommitRequest.getApplicationData());
}