Skip to content

Commit f020176

Browse files
berndrueckermegglos
authored andcommitted
Rename annotations (camunda-community-hub/spring-zeebe#239). Removed dedicated reader classes to ease deprecation handling
1 parent 0902bef commit f020176

File tree

2 files changed

+14
-10
lines changed
  • test
    • embedded/src/test/java/io/camunda/zeebe/spring/client/jobhandling
    • testcontainer/src/test/java/io/camunda/zeebe/spring/client/jobhandling

2 files changed

+14
-10
lines changed

test/embedded/src/test/java/io/camunda/zeebe/spring/client/jobhandling/JobHandlerTest.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import io.camunda.zeebe.model.bpmn.Bpmn;
88
import io.camunda.zeebe.model.bpmn.BpmnModelInstance;
99
import io.camunda.zeebe.model.bpmn.builder.ServiceTaskBuilder;
10+
import io.camunda.zeebe.spring.client.annotation.JobWorker;
11+
import io.camunda.zeebe.spring.client.annotation.Variable;
1012
import io.camunda.zeebe.spring.client.annotation.ZeebeVariable;
1113
import io.camunda.zeebe.spring.client.annotation.ZeebeWorker;
1214
import io.camunda.zeebe.spring.client.annotation.customizer.ZeebeWorkerValueCustomizer;
@@ -62,7 +64,7 @@ public ZeebeWorkerValueCustomizer zeebeWorkerValueCustomizer() {
6264
private static ComplexTypeDTO test6ComplexTypeDTO = null;
6365
private static String test6Var2 = null;
6466

65-
@ZeebeWorker(name="test1", type = "test1", autoComplete = true)
67+
@JobWorker(name="test1", type = "test1", autoComplete = true)
6668
public void handleTest1(JobClient client, ActivatedJob job) {
6769
calledTest1 = true;
6870
}
@@ -84,7 +86,7 @@ public void testAutoComplete() {
8486
assertTrue(calledTest1);
8587
}
8688

87-
@ZeebeWorker(type = "test2", autoComplete = true)
89+
@JobWorker(type = "test2", autoComplete = true)
8890
public void handleTest2(JobClient client, ActivatedJob job) {
8991
// Complete it here to trigger a not found in the auto complete, which will be ignored
9092
client.newCompleteCommand(job.getKey()).send().join();
@@ -109,7 +111,7 @@ public void testAutoCompleteOnAlreadyCompletedJob() {
109111
assertTrue(calledTest2);
110112
}
111113

112-
@ZeebeWorker(name = "test3", type = "test3", autoComplete = true, pollInterval = 10, enabled = false)
114+
@JobWorker(name = "test3", type = "test3", autoComplete = true, pollInterval = 10, enabled = false)
113115
public void handeTest3Disabled(final JobClient client, final ActivatedJob job) {
114116
calledTest3 = true;
115117
}
@@ -131,7 +133,7 @@ void shouldNotActivateJobInAnnotationDisabledWorker() {
131133
assertThat(calledTest3).isFalse();
132134
}
133135

134-
@ZeebeWorker(name = "test4", type = "test4", autoComplete = true, pollInterval = 10)
136+
@JobWorker(name = "test4", type = "test4", autoComplete = true, pollInterval = 10)
135137
public void handeTest4(final JobClient client, final ActivatedJob job) {
136138
calledTest4 = true;
137139
}
@@ -156,7 +158,7 @@ void shouldNotActivateJobInPropertiesDisabledWorker() {
156158
assertThat(calledTest4).isFalse();
157159
}
158160

159-
@ZeebeWorker(name = "test5")
161+
@JobWorker(name = "test5", autoComplete = false)
160162
public void handeTest5() {
161163
}
162164

@@ -165,8 +167,8 @@ public void testWorkerDefaultType() {
165167
assertTrue(jobWorkerManager.findJobWorkerConfigByType("DefaultType").isPresent());
166168
}
167169

168-
@ZeebeWorker(name = "test6", type = "test6", autoComplete = true, pollInterval = 10)
169-
public void handleTest6(final JobClient client, final ActivatedJob job, @ZeebeVariable ComplexTypeDTO dto, @ZeebeVariable String var2) {
170+
@JobWorker(name = "test6", type = "test6", pollInterval = 10)
171+
public void handleTest6(final JobClient client, final ActivatedJob job, @Variable ComplexTypeDTO dto, @Variable String var2) {
170172
calledTest6 = true;
171173
test6ComplexTypeDTO = dto;
172174
test6Var2 = var2;

test/testcontainer/src/test/java/io/camunda/zeebe/spring/client/jobhandling/SmokeTest.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import io.camunda.zeebe.model.bpmn.Bpmn;
88
import io.camunda.zeebe.model.bpmn.BpmnModelInstance;
99
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
10+
import io.camunda.zeebe.spring.client.annotation.JobWorker;
11+
import io.camunda.zeebe.spring.client.annotation.Variable;
1012
import io.camunda.zeebe.spring.client.annotation.ZeebeVariable;
1113
import io.camunda.zeebe.spring.client.annotation.ZeebeWorker;
1214
import io.camunda.zeebe.spring.test.ZeebeSpringTest;
@@ -43,7 +45,7 @@ public class SmokeTest {
4345
private static ComplexTypeDTO test2ComplexTypeDTO = null;
4446
private static String test2Var2 = null;
4547

46-
@ZeebeWorker(name="test1", type = "test1", autoComplete = true)
48+
@JobWorker(name="test1", type = "test1") // autoComplete is true
4749
public void handleTest1(JobClient client, ActivatedJob job) {
4850
calledTest1 = true;
4951
}
@@ -66,8 +68,8 @@ public void testAutoComplete() {
6668
assertTrue(calledTest1);
6769
}
6870

69-
@ZeebeWorker(name = "test2", type = "test2", autoComplete = true, pollInterval = 10)
70-
public void handleTest2(final JobClient client, final ActivatedJob job, @ZeebeVariable ComplexTypeDTO dto, @ZeebeVariable String var2) {
71+
@JobWorker(name = "test2", type = "test2", pollInterval = 10)
72+
public void handleTest2(final JobClient client, final ActivatedJob job, @Variable ComplexTypeDTO dto, @Variable String var2) {
7173
calledTest2 = true;
7274
test2ComplexTypeDTO = dto;
7375
test2Var2 = var2;

0 commit comments

Comments
 (0)