@Test
public void convert2Proto() {

    BranchRegisterRequest branchRegisterRequest = new BranchRegisterRequest();
    branchRegisterRequest.setApplicationData("data");
    branchRegisterRequest.setBranchType(BranchType.AT);
    branchRegisterRequest.setLockKey("localKey");
    branchRegisterRequest.setResourceId("resourceId");
    branchRegisterRequest.setXid("xid");
    BranchRegisterRequestConvertor convertor = new BranchRegisterRequestConvertor();
    BranchRegisterRequestProto proto = convertor.convert2Proto(
        branchRegisterRequest);
    BranchRegisterRequest real = convertor.convert2Model(proto);
    assertThat(real.getTypeCode()).isEqualTo(branchRegisterRequest.getTypeCode());
    assertThat(real.getApplicationData()).isEqualTo(branchRegisterRequest.getApplicationData());
    assertThat(real.getXid()).isEqualTo(branchRegisterRequest.getXid());
    assertThat(real.getBranchType()).isEqualTo(branchRegisterRequest.getBranchType());
    assertThat(real.getLockKey()).isEqualTo(branchRegisterRequest.getLockKey());
    assertThat(real.getResourceId()).isEqualTo(branchRegisterRequest.getResourceId());
}