Skip to content

Commit 914dc6e

Browse files
Merge pull request #176 from conductor-oss/lpeng/fix-set-workflow-tags-method
Fix setWorkflowTags to send PUT
2 parents 2c71fdb + 3d9bd5a commit 914dc6e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎conductor-client/src/main/java/io/orkes/conductor/client/http/TagsResource.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void setTaskTags(List<TagObject> tagObjects, String taskName) {
128128

129129
public void setWorkflowTags(List<TagObject> tagObjects, String workflow) {
130130
ConductorClientRequest request = ConductorClientRequest.builder()
131-
.method(Method.GET)
131+
.method(Method.PUT)
132132
.path("/metadata/workflow/{workflow}/tags")
133133
.addPathParam("workflow", workflow)
134134
.body(tagObjects)

‎tests/src/test/java/io/orkes/conductor/client/http/MetadataClientTests.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ void tagWorkflow() {
108108
}
109109
}
110110
metadataClient.addWorkflowTag(tagObject, Commons.WORKFLOW_NAME);
111-
metadataClient.setWorkflowTags(List.of(tagObject), Commons.WORKFLOW_NAME);
111+
// A different tag, so the assertion fails unless setWorkflowTags replaces the existing one.
112+
TagObject replacement = new TagObject().key(tagObject.getKey()).value(tagObject.getValue() + "-replaced");
113+
metadataClient.setWorkflowTags(List.of(replacement), Commons.WORKFLOW_NAME);
112114
List<TagObject> tags = metadataClient.getWorkflowTags(Commons.WORKFLOW_NAME);
113-
Assertions.assertIterableEquals(List.of(tagObject), tags);
115+
Assertions.assertIterableEquals(List.of(replacement), tags);
114116
}
115117

116118
// ==================== Additional CRUD Tests ====================

0 commit comments

Comments
 (0)