-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from camunda/rest-client-fix
fix(zeebe): add headers to all REST method calls
- Loading branch information
Showing
8 changed files
with
115 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1is74t8" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.23.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.5.0"> | ||
<bpmn:process id="zeebe-user-task-test" name="Zeebe User Task test" isExecutable="true"> | ||
<bpmn:startEvent id="StartEvent_1" name="Start Zeebe User Task test"> | ||
<bpmn:outgoing>Flow_0k05u9v</bpmn:outgoing> | ||
</bpmn:startEvent> | ||
<bpmn:sequenceFlow id="Flow_0k05u9v" sourceRef="StartEvent_1" targetRef="Activity_1d6heog" /> | ||
<bpmn:endEvent id="Event_0f0ejpu" name="Zeebe User Task test completed"> | ||
<bpmn:incoming>Flow_1sm7z6x</bpmn:incoming> | ||
</bpmn:endEvent> | ||
<bpmn:sequenceFlow id="Flow_1sm7z6x" sourceRef="Activity_1d6heog" targetRef="Event_0f0ejpu" /> | ||
<bpmn:userTask id="Activity_1d6heog" name="zeebe-user-task"> | ||
<bpmn:extensionElements> | ||
<zeebe:userTask /> | ||
</bpmn:extensionElements> | ||
<bpmn:incoming>Flow_0k05u9v</bpmn:incoming> | ||
<bpmn:outgoing>Flow_1sm7z6x</bpmn:outgoing> | ||
</bpmn:userTask> | ||
</bpmn:process> | ||
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> | ||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="zeebe-user-task-test"> | ||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> | ||
<dc:Bounds x="179" y="99" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="155" y="142" width="84" height="27" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_0f0ejpu_di" bpmnElement="Event_0f0ejpu"> | ||
<dc:Bounds x="432" y="99" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="409" y="142" width="83" height="27" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Activity_118tltf_di" bpmnElement="Activity_1d6heog"> | ||
<dc:Bounds x="270" y="77" width="100" height="80" /> | ||
<bpmndi:BPMNLabel /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="Flow_0k05u9v_di" bpmnElement="Flow_0k05u9v"> | ||
<di:waypoint x="215" y="117" /> | ||
<di:waypoint x="270" y="117" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_1sm7z6x_di" bpmnElement="Flow_1sm7z6x"> | ||
<di:waypoint x="370" y="117" /> | ||
<di:waypoint x="432" y="117" /> | ||
</bpmndi:BPMNEdge> | ||
</bpmndi:BPMNPlane> | ||
</bpmndi:BPMNDiagram> | ||
</bpmn:definitions> |
File renamed without changes.
33 changes: 33 additions & 0 deletions
33
src/__tests__/zeebe/integration-rest/UserTask-rest.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { TasklistApiClient } from '../../../tasklist' | ||
import { ZeebeGrpcClient, ZeebeRestClient } from '../../../zeebe' | ||
|
||
jest.setTimeout(30000) | ||
test('can update a task', async () => { | ||
const grpc = new ZeebeGrpcClient() | ||
|
||
await grpc.deployResource({ | ||
processFilename: './src/__tests__/testdata/zeebe-user-task.bpmn', | ||
}) | ||
await grpc.createProcessInstance({ | ||
bpmnProcessId: 'zeebe-user-task-test', | ||
variables: {}, | ||
}) | ||
const tasklist = new TasklistApiClient() | ||
await new Promise((resolve) => setTimeout(resolve, 10000)) | ||
const tasks = await tasklist.searchTasks({ | ||
state: 'CREATED', | ||
}) | ||
const zbc = new ZeebeRestClient() | ||
const res = await zbc.completeUserTask({ | ||
userTaskKey: tasks[0].id, | ||
}) | ||
expect(res.statusCode).toBe(204) | ||
const res2 = await zbc | ||
.completeUserTask({ | ||
userTaskKey: '2251799814261421', | ||
}) | ||
.catch((e) => { | ||
return e | ||
}) | ||
expect(res2.statusCode).toBe(404) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters