Search in sources :

Example 1 with MockProcessRouter

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

the class ProcessControllerTests method createProcessorController.

private ProcessControllerImpl createProcessorController(ProcessCtrlEventPublisher eventPublisher) throws Exception {
    DefaultRouterHandler defaultRouterHandler = new DefaultRouterHandler();
    defaultRouterHandler.setEventPublisher(eventPublisher);
    Map<String, ProcessRouter> processRouterMap = new HashMap<>(1);
    processRouterMap.put(ProcessType.STATE_LANG.getCode(), new MockProcessRouter());
    defaultRouterHandler.setProcessRouters(processRouterMap);
    CustomizeBusinessProcessor customizeBusinessProcessor = new CustomizeBusinessProcessor();
    Map<String, ProcessHandler> processHandlerMap = new HashMap<>(1);
    processHandlerMap.put(ProcessType.STATE_LANG.getCode(), new MockProcessHandler());
    customizeBusinessProcessor.setProcessHandlers(processHandlerMap);
    Map<String, RouterHandler> routerHandlerMap = new HashMap<>(1);
    routerHandlerMap.put(ProcessType.STATE_LANG.getCode(), defaultRouterHandler);
    customizeBusinessProcessor.setRouterHandlers(routerHandlerMap);
    ProcessControllerImpl processorController = new ProcessControllerImpl();
    processorController.setBusinessProcessor(customizeBusinessProcessor);
    return processorController;
}
Also used : DefaultRouterHandler(io.seata.saga.proctrl.handler.DefaultRouterHandler) CustomizeBusinessProcessor(io.seata.saga.proctrl.process.impl.CustomizeBusinessProcessor) HashMap(java.util.HashMap) MockProcessRouter(io.seata.saga.proctrl.mock.MockProcessRouter) MockProcessHandler(io.seata.saga.proctrl.mock.MockProcessHandler) ProcessControllerImpl(io.seata.saga.proctrl.impl.ProcessControllerImpl) RouterHandler(io.seata.saga.proctrl.handler.RouterHandler) DefaultRouterHandler(io.seata.saga.proctrl.handler.DefaultRouterHandler) MockProcessRouter(io.seata.saga.proctrl.mock.MockProcessRouter) ProcessHandler(io.seata.saga.proctrl.handler.ProcessHandler) MockProcessHandler(io.seata.saga.proctrl.mock.MockProcessHandler)

Aggregations

DefaultRouterHandler (io.seata.saga.proctrl.handler.DefaultRouterHandler)1 ProcessHandler (io.seata.saga.proctrl.handler.ProcessHandler)1 RouterHandler (io.seata.saga.proctrl.handler.RouterHandler)1 ProcessControllerImpl (io.seata.saga.proctrl.impl.ProcessControllerImpl)1 MockProcessHandler (io.seata.saga.proctrl.mock.MockProcessHandler)1 MockProcessRouter (io.seata.saga.proctrl.mock.MockProcessRouter)1 CustomizeBusinessProcessor (io.seata.saga.proctrl.process.impl.CustomizeBusinessProcessor)1 HashMap (java.util.HashMap)1