Search in sources :

Example 6 with GlobalCommitRequest

use of io.seata.core.protocol.transaction.GlobalCommitRequest in project seata by seata.

the class GlobalCommitRequestConvertorTest method convert2Proto.

@Test
public void convert2Proto() {
    GlobalCommitRequest globalCommitRequest = new GlobalCommitRequest();
    globalCommitRequest.setExtraData("extraData");
    globalCommitRequest.setXid("xid");
    GlobalCommitRequestConvertor convertor = new GlobalCommitRequestConvertor();
    GlobalCommitRequestProto proto = convertor.convert2Proto(globalCommitRequest);
    GlobalCommitRequest real = convertor.convert2Model(proto);
    assertThat((real.getTypeCode())).isEqualTo(globalCommitRequest.getTypeCode());
    assertThat((real.getXid())).isEqualTo(globalCommitRequest.getXid());
    assertThat((real.getExtraData())).isEqualTo(globalCommitRequest.getExtraData());
}
Also used : GlobalCommitRequest(io.seata.core.protocol.transaction.GlobalCommitRequest) GlobalCommitRequestProto(io.seata.serializer.protobuf.generated.GlobalCommitRequestProto) Test(org.junit.jupiter.api.Test)

Aggregations

GlobalCommitRequest (io.seata.core.protocol.transaction.GlobalCommitRequest)6 GlobalCommitResponse (io.seata.core.protocol.transaction.GlobalCommitResponse)3 Test (org.junit.jupiter.api.Test)3 StoreException (io.seata.common.exception.StoreException)1 TransactionException (io.seata.core.exception.TransactionException)1 GlobalBeginRequest (io.seata.core.protocol.transaction.GlobalBeginRequest)1 GlobalBeginResponse (io.seata.core.protocol.transaction.GlobalBeginResponse)1 GlobalRollbackRequest (io.seata.core.protocol.transaction.GlobalRollbackRequest)1 GlobalRollbackResponse (io.seata.core.protocol.transaction.GlobalRollbackResponse)1 RpcContext (io.seata.core.rpc.RpcContext)1 Measurement (io.seata.metrics.Measurement)1 GlobalCommitRequestProto (io.seata.serializer.protobuf.generated.GlobalCommitRequestProto)1 MockServerMessageSender (io.seata.server.coordinator.DefaultCoordinatorTest.MockServerMessageSender)1 HashMap (java.util.HashMap)1