1
0

调整核心类的创建方式

This commit is contained in:
2025-01-03 16:10:37 +08:00
parent 45ce5a2615
commit 743e2db17d
8 changed files with 76 additions and 91 deletions

View File

@@ -32,12 +32,12 @@ public abstract class TestFlowableManager {
}
private FlowableNode createManualNode(String nodeId, Map<FlowableAction, String> nextNodes) {
return new FlowableNode(
nodeId,
UUID.randomUUID().toString(),
UUID.randomUUID().toString(),
nextNodes
);
return FlowableNode.builder()
.nodeId(nodeId)
.name(UUID.randomUUID().toString())
.description(UUID.randomUUID().toString())
.targets(nextNodes)
.build();
}
/**
@@ -125,14 +125,12 @@ public abstract class TestFlowableManager {
@Test
public void testSuspend() {
FlowableManager manager = flowableManager();
FlowableNode node = new FlowableNode(
"edf1b7b0-f45b-4256-b696-ce84857f03f7",
"edf1b7b0-f45b-4256-b696-ce84857f03f7",
"edf1b7b0-f45b-4256-b696-ce84857f03f7",
FlowableNode.Type.MANUAL,
TwoApproveHandler.class,
null
);
FlowableNode node = FlowableNode.builder()
.nodeId("50342cb7-2029-4159-bd4c-cbfa4aebe474")
.name("50342cb7-2029-4159-bd4c-cbfa4aebe474")
.description("50342cb7-2029-4159-bd4c-cbfa4aebe474")
.handler(TwoApproveHandler.class.getName())
.build();
manager.create(node);
String instanceId = manager.start(node.getNodeId());
@@ -148,13 +146,13 @@ public abstract class TestFlowableManager {
@Test
public void testAutomaticNode() {
FlowableManager manager = flowableManager();
FlowableNode node = new FlowableNode(
"2733d930-7a4b-491e-b1ca-4d5811435e9f",
"自动节点",
"自动节点",
getAutomaticNodeClass(),
null
);
FlowableNode node = FlowableNode.builder()
.nodeId("5d60dab0-7691-4543-b753-af7ac02cb7ec")
.name("5d60dab0-7691-4543-b753-af7ac02cb7ec")
.description("5d60dab0-7691-4543-b753-af7ac02cb7ec")
.type(FlowableNode.Type.AUTOMATIC)
.handler(getAutomaticNodeClass().getName())
.build();
manager.create(node);
String instanceId = manager.start(node.getNodeId());
Assertions.assertEquals(FlowableInstance.Status.COMPLETED, manager.getInstance(instanceId).getStatus());