Search in sources :

Example 1 with MockInstruction

use of io.seata.saga.proctrl.mock.MockInstruction in project seata by seata.

the class ProcessControllerTests method testSimpleProcessCtrl.

@Test
public void testSimpleProcessCtrl() {
    try {
        ProcessCtrlEventPublisher processCtrlEventPublisher = buildEventPublisher();
        ProcessContext context = new ProcessContextImpl();
        MockInstruction instruction = new MockInstruction();
        instruction.setTestString("one");
        context.setInstruction(instruction);
        context.setVariable("TEST", "test");
        processCtrlEventPublisher.publish(context);
    } catch (Exception e) {
        Assertions.fail(e);
    }
}
Also used : ProcessContextImpl(io.seata.saga.proctrl.impl.ProcessContextImpl) MockInstruction(io.seata.saga.proctrl.mock.MockInstruction) ProcessCtrlEventPublisher(io.seata.saga.proctrl.eventing.impl.ProcessCtrlEventPublisher) Test(org.junit.jupiter.api.Test)

Example 2 with MockInstruction

use of io.seata.saga.proctrl.mock.MockInstruction in project seata by seata.

the class ProcessControllerTests method testSimpleProcessCtrlAsync.

@Test
public void testSimpleProcessCtrlAsync() {
    try {
        ProcessCtrlEventPublisher processCtrlEventPublisher = buildAsyncEventPublisher();
        ProcessContext context = new ProcessContextImpl();
        MockInstruction instruction = new MockInstruction();
        instruction.setTestString("one");
        context.setInstruction(instruction);
        context.setVariable("TEST", "test");
        processCtrlEventPublisher.publish(context);
    } catch (Exception e) {
        Assertions.fail(e);
    }
}
Also used : ProcessContextImpl(io.seata.saga.proctrl.impl.ProcessContextImpl) MockInstruction(io.seata.saga.proctrl.mock.MockInstruction) ProcessCtrlEventPublisher(io.seata.saga.proctrl.eventing.impl.ProcessCtrlEventPublisher) Test(org.junit.jupiter.api.Test)

Aggregations

ProcessCtrlEventPublisher (io.seata.saga.proctrl.eventing.impl.ProcessCtrlEventPublisher)2 ProcessContextImpl (io.seata.saga.proctrl.impl.ProcessContextImpl)2 MockInstruction (io.seata.saga.proctrl.mock.MockInstruction)2 Test (org.junit.jupiter.api.Test)2