use of io.seata.core.protocol.transaction.GlobalRollbackRequest in project seata by seata.
the class GlobalRollbackRequestConvertor method convert2Model.
@Override
public GlobalRollbackRequest convert2Model(GlobalRollbackRequestProto globalRollbackRequestProto) {
GlobalRollbackRequest branchCommitRequest = new GlobalRollbackRequest();
branchCommitRequest.setExtraData(globalRollbackRequestProto.getAbstractGlobalEndRequest().getExtraData());
branchCommitRequest.setXid(globalRollbackRequestProto.getAbstractGlobalEndRequest().getXid());
return branchCommitRequest;
}
use of io.seata.core.protocol.transaction.GlobalRollbackRequest in project seata by seata.
the class GlobalRollbackRequestConvertorTest method convert2Proto.
@Test
public void convert2Proto() {
GlobalRollbackRequest globalRollbackRequest = new GlobalRollbackRequest();
globalRollbackRequest.setExtraData("extraData");
globalRollbackRequest.setXid("xid");
GlobalRollbackRequestConvertor convertor = new GlobalRollbackRequestConvertor();
GlobalRollbackRequestProto proto = convertor.convert2Proto(globalRollbackRequest);
GlobalRollbackRequest real = convertor.convert2Model(proto);
assertThat((real.getTypeCode())).isEqualTo(globalRollbackRequest.getTypeCode());
assertThat((real.getXid())).isEqualTo(globalRollbackRequest.getXid());
assertThat((real.getExtraData())).isEqualTo(globalRollbackRequest.getExtraData());
}
Aggregations