Skip to content

Commit

Permalink
Rename annotations (camunda-community-hub/spring-zeebe#239). Removed …
Browse files Browse the repository at this point in the history
…dedicated reader classes to ease deprecation handling

(cherry picked from commit f020176)
  • Loading branch information
berndruecker authored and megglos committed Jan 2, 2025
1 parent 13103dd commit 911c56e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import io.camunda.zeebe.model.bpmn.Bpmn;
import io.camunda.zeebe.model.bpmn.BpmnModelInstance;
import io.camunda.zeebe.model.bpmn.builder.ServiceTaskBuilder;
import io.camunda.zeebe.spring.client.annotation.JobWorker;
import io.camunda.zeebe.spring.client.annotation.Variable;
import io.camunda.zeebe.spring.client.annotation.ZeebeVariable;
import io.camunda.zeebe.spring.client.annotation.ZeebeWorker;
import io.camunda.zeebe.spring.client.annotation.customizer.ZeebeWorkerValueCustomizer;
Expand Down Expand Up @@ -62,7 +64,7 @@ public ZeebeWorkerValueCustomizer zeebeWorkerValueCustomizer() {
private static ComplexTypeDTO test6ComplexTypeDTO = null;
private static String test6Var2 = null;

@ZeebeWorker(name="test1", type = "test1", autoComplete = true)
@JobWorker(name="test1", type = "test1", autoComplete = true)
public void handleTest1(JobClient client, ActivatedJob job) {
calledTest1 = true;
}
Expand All @@ -84,7 +86,7 @@ public void testAutoComplete() {
assertTrue(calledTest1);
}

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

@ZeebeWorker(name = "test3", type = "test3", autoComplete = true, pollInterval = 10, enabled = false)
@JobWorker(name = "test3", type = "test3", autoComplete = true, pollInterval = 10, enabled = false)
public void handeTest3Disabled(final JobClient client, final ActivatedJob job) {
calledTest3 = true;
}
Expand All @@ -131,7 +133,7 @@ void shouldNotActivateJobInAnnotationDisabledWorker() {
assertThat(calledTest3).isFalse();
}

@ZeebeWorker(name = "test4", type = "test4", autoComplete = true, pollInterval = 10)
@JobWorker(name = "test4", type = "test4", autoComplete = true, pollInterval = 10)
public void handeTest4(final JobClient client, final ActivatedJob job) {
calledTest4 = true;
}
Expand All @@ -156,7 +158,7 @@ void shouldNotActivateJobInPropertiesDisabledWorker() {
assertThat(calledTest4).isFalse();
}

@ZeebeWorker(name = "test5")
@JobWorker(name = "test5", autoComplete = false)
public void handeTest5() {
}

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

@ZeebeWorker(name = "test6", type = "test6", autoComplete = true, pollInterval = 10)
public void handleTest6(final JobClient client, final ActivatedJob job, @ZeebeVariable ComplexTypeDTO dto, @ZeebeVariable String var2) {
@JobWorker(name = "test6", type = "test6", pollInterval = 10)
public void handleTest6(final JobClient client, final ActivatedJob job, @Variable ComplexTypeDTO dto, @Variable String var2) {
calledTest6 = true;
test6ComplexTypeDTO = dto;
test6Var2 = var2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import io.camunda.zeebe.model.bpmn.Bpmn;
import io.camunda.zeebe.model.bpmn.BpmnModelInstance;
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.spring.client.annotation.JobWorker;
import io.camunda.zeebe.spring.client.annotation.Variable;
import io.camunda.zeebe.spring.client.annotation.ZeebeVariable;
import io.camunda.zeebe.spring.client.annotation.ZeebeWorker;
import io.camunda.zeebe.spring.test.ZeebeSpringTest;
Expand Down Expand Up @@ -43,7 +45,7 @@ public class SmokeTest {
private static ComplexTypeDTO test2ComplexTypeDTO = null;
private static String test2Var2 = null;

@ZeebeWorker(name="test1", type = "test1", autoComplete = true)
@JobWorker(name="test1", type = "test1") // autoComplete is true
public void handleTest1(JobClient client, ActivatedJob job) {
calledTest1 = true;
}
Expand All @@ -66,8 +68,8 @@ public void testAutoComplete() {
assertTrue(calledTest1);
}

@ZeebeWorker(name = "test2", type = "test2", autoComplete = true, pollInterval = 10)
public void handleTest2(final JobClient client, final ActivatedJob job, @ZeebeVariable ComplexTypeDTO dto, @ZeebeVariable String var2) {
@JobWorker(name = "test2", type = "test2", pollInterval = 10)
public void handleTest2(final JobClient client, final ActivatedJob job, @Variable ComplexTypeDTO dto, @Variable String var2) {
calledTest2 = true;
test2ComplexTypeDTO = dto;
test2Var2 = var2;
Expand Down

0 comments on commit 911c56e

Please sign in to comment.