use of io.seata.saga.proctrl.mock.MockProcessHandler 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;
}
Aggregations