diff --git a/camunda-bpm-camel-cdi/pom.xml b/camunda-bpm-camel-cdi/pom.xml
deleted file mode 100644
index 52927d7..0000000
--- a/camunda-bpm-camel-cdi/pom.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-
- camunda BPM - Apache Camel Integration (CDI)
- camunda-bpm-camel-cdi
-
-
- org.camunda.bpm.extension.camel
- camunda-bpm-camel
- 0.9.0-SNAPSHOT
-
- 4.0.0
-
-
- true
-
-
-
-
- org.camunda.bpm.extension.camel
- camunda-bpm-camel-common
-
-
- org.camunda.bpm
- camunda-engine
- ${camunda-bpm.version}
- provided
-
-
- org.camunda.bpm
- camunda-engine-cdi
- ${camunda-bpm.version}
-
-
-
- org.slf4j
- slf4j-api
- ${sl4j.version}
-
-
- org.slf4j
- jcl-over-slf4j
- ${sl4j.version}
-
-
- org.slf4j
- slf4j-log4j12
- ${sl4j.version}
-
-
-
-
- org.apache.camel
- camel-core
- ${camel.version}
-
-
- org.apache.camel
- camel-cdi
- ${camel.version}
-
-
-
-
- org.camunda.bpm.extension.camel
- camunda-bpm-camel-common-tests
-
-
- junit
- junit
- ${junit.version}
- test
-
-
- com.h2database
- h2
- ${h2.version}
- test
-
-
- org.apache.camel
- camel-mvel
- ${camel.version}
- test
-
-
- com.fasterxml.uuid
- java-uuid-generator
- 4.0.1
- test
-
-
- org.easytesting
- fest-assert-core
- ${fest.assert.version}
- test
-
-
- org.jboss.as
- jboss-as-arquillian-container-remote
- 7.1.3.Final
- test
-
-
- org.jboss.arquillian.junit
- arquillian-junit-container
- 1.0.3.Final
- test
-
-
- org.jboss.spec
- jboss-javaee-6.0
- 2.0.0.Final
- pom
- provided
-
-
- xalan
- org.apache.xalan
-
-
-
-
-
-
-
-
-
-
-
-
- maven-failsafe-plugin
- 2.22.2
-
-
- -Djava.util.logging.config.file=${basedir}/src/test/resources/logging.properties
- ${project.build.sourceEncoding}
-
-
-
- failsafe-integration-tests
- integration-test
-
- integration-test
-
-
-
- failsafe-verify
- verify
-
- verify
-
-
-
-
-
-
-
diff --git a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/ArquillianTestsProcessApplication.java b/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/ArquillianTestsProcessApplication.java
deleted file mode 100644
index b7af433..0000000
--- a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/ArquillianTestsProcessApplication.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.camunda.bpm.camel.cdi;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.camunda.bpm.application.ProcessApplication;
-import org.camunda.bpm.application.ProcessApplicationInterface;
-import org.camunda.bpm.application.impl.EjbProcessApplication;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.ejb.*;
-import javax.inject.Inject;
-
-/**
- * We need this class because @Startup annotations are lazily instantiated and not *really* initalized at
- * startup. We use this class to make sure that the CamelContextBootstrap is initialized at startup.
- */
-@Singleton
-@Startup
-@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
-@TransactionAttribute(TransactionAttributeType.REQUIRED)
-@ProcessApplication
-@Local(ProcessApplicationInterface.class)
-public class ArquillianTestsProcessApplication extends EjbProcessApplication {
-
- private static final Logger LOG = LoggerFactory.getLogger(ArquillianTestsProcessApplication.class);
-
- @Inject
- CamelContextBootstrap camelContext;
-
- /*
- * Every integration test needs to provide a method that will return the Camel route
- * to be use for testing with a @Produces annotation
- */
- @Inject
- RouteBuilder testRoute;
-
- @PostConstruct
- public void start() throws Exception {
- LOG.info(">>");
- LOG.info(">> Starting the ArquillianTestsProcessApplication ");
- LOG.info(">>");
-
- camelContext.addRoute(testRoute);
- camelContext.start();
- deploy();
- }
-
- @PreDestroy
- public void stop() {
- undeploy();
- }
-
-}
\ No newline at end of file
diff --git a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/BaseArquillianIntegrationTest.java b/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/BaseArquillianIntegrationTest.java
deleted file mode 100644
index d08a5d8..0000000
--- a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/BaseArquillianIntegrationTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.camunda.bpm.camel.cdi;
-
-import org.camunda.bpm.camel.common.CamelService;
-import org.camunda.bpm.camel.spring.util.LogService;
-import org.camunda.bpm.camel.spring.util.LogServiceImpl;
-import org.camunda.bpm.engine.HistoryService;
-import org.camunda.bpm.engine.RuntimeService;
-import org.camunda.bpm.engine.TaskService;
-import org.jboss.shrinkwrap.api.ArchivePaths;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
-import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
-
-import javax.inject.Inject;
-
-public abstract class BaseArquillianIntegrationTest {
-
- @Inject
- @SuppressWarnings("cdi-ambiguous-dependency")
- protected RuntimeService runtimeService;
-
- @Inject
- @SuppressWarnings("cdi-ambiguous-dependency")
- protected TaskService taskService;
-
- @Inject
- @SuppressWarnings("cdi-ambiguous-dependency")
- protected HistoryService historyService;
-
- @Inject
- CamelContextBootstrap camelContextBootstrap;
-
- @Inject
- CamelService camelService;
-
- protected static WebArchive prepareTestDeployment(String deploymentArchiveName,
- String processDefinition) {
- MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class)
- .loadMetadataFromPom("pom.xml");
-
- WebArchive war = ShrinkWrap.create(WebArchive.class, deploymentArchiveName + ".war")
- .addAsLibraries(resolver.artifact("org.camunda.bpm:camunda-engine-cdi").resolveAsFiles())
- .addAsLibraries(resolver.artifact("org.camunda.bpm.extension.camel:camunda-bpm-camel-common").resolveAsFiles())
- .addAsLibraries(resolver.artifact("org.apache.camel:camel-core").resolveAsFiles())
- .addAsLibraries(resolver.artifact("org.apache.camel:camel-cdi").resolveAsFiles())
- .addAsLibraries(resolver.artifact("org.easytesting:fest-assert-core").resolveAsFiles())
- // FIXME: this does not work we need to add this project's resources one by one
- //.addAsLibraries(resolver.artifact("org.camunda.bpm.extension.camel:camunda-bpm-camel-cdi").resolveAsFiles())
- .addClass(CamelServiceImpl.class)
- .addClass(BaseArquillianIntegrationTest.class)
- .addClass(ArquillianTestsProcessApplication.class)
- .addClass(CamelContextBootstrap.class)
-
- .addClass(LogService.class)
- .addClass(LogServiceImpl.class)
- .addClass(LogServiceCdiImpl.class)
-
- //.addClass(camelRouteClass)
- .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"))
- .addAsWebResource("META-INF/processes.xml", "WEB-INF/classes/META-INF/processes.xml")
- .addAsResource(processDefinition)
- ;
-
- /*
- * For troubleshooting purposes use the following two lines to export the WAR to the filesystem
- * to see if everything needed is there!
- */
- //File destinationDir = new File("/Users/rafa/dev/plexiti/vc/the-job-announcement-fox/target");
- //war.as(ExplodedExporter.class).exportExploded(destinationDir);
-
- return war;
- }
-}
diff --git a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/LogServiceCdiImpl.java b/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/LogServiceCdiImpl.java
deleted file mode 100644
index 4b68c7c..0000000
--- a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/LogServiceCdiImpl.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.camunda.bpm.camel.cdi;
-
-import javax.inject.Named;
-
-import org.camunda.bpm.camel.spring.util.LogServiceImpl;
-
-@Named("log")
-public class LogServiceCdiImpl extends LogServiceImpl {
-
-}
diff --git a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/ReceiveFromCamelIT.java b/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/ReceiveFromCamelIT.java
deleted file mode 100644
index 846141a..0000000
--- a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/ReceiveFromCamelIT.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.camunda.bpm.camel.cdi;
-
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.cdi.Uri;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.camunda.bpm.engine.runtime.ProcessInstance;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.*;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.fest.assertions.api.Assertions.assertThat;
-
-@RunWith(Arquillian.class)
-public class ReceiveFromCamelIT extends BaseArquillianIntegrationTest {
-
- private static String PROCESS_DEFINITION_KEY = "receiveFromCamelProcess";
-
- @Deployment
- public static WebArchive createDeployment() {
- return prepareTestDeployment(PROCESS_DEFINITION_KEY, "process/ReceiveFromCamel.bpmn20.xml");
- }
-
- @Inject
- @Uri("mock:resultEndpoint")
- MockEndpoint resultEndpoint;
-
- @Produces
- @ApplicationScoped
- public RouteBuilder createRoute() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:sendToCamundaBpm")
- .routeId("receive-from-camel-route")
- .to("log:org.camunda.bpm.camel.cdi?level=INFO&showAll=true&multiline=true")
- .to("camunda-bpm://signal?processDefinitionKey=receiveFromCamelProcess&activityId=waitForCamel")
- .to("log:org.camunda.bpm.camel.cdi?level=INFO&showAll=true&multiline=true")
- .to(resultEndpoint)
- ;
- }
- };
- }
-
- @Test
- public void doTest() throws InterruptedException {
- Map processVariables = new HashMap();
- processVariables.put("var1", "foo");
- processVariables.put("var2", "bar");
- ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("receiveFromCamelProcess", processVariables);
-
- // Verify that a process instance has executed and there is one instance executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("receiveFromCamelProcess").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("receiveFromCamelProcess").count()).isEqualTo(1);
-
- /*
- * We need the process instance ID to be able to send the message to it
- *
- * FIXME: we need to fix this with the process execution id or even better with the Activity Instance Model
- * http://camundabpm.blogspot.de/2013/06/introducing-activity-instance-model-to.html
- */
- ProducerTemplate tpl = camelContextBootstrap.getCamelContext().createProducerTemplate();
- tpl.sendBodyAndProperty("direct:sendToCamundaBpm", null, EXCHANGE_HEADER_PROCESS_INSTANCE_ID, processInstance.getId());
-
- // Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(resultEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(processInstance.getId());
-
- // Assert that the process instance is finished
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("receiveFromCamelProcess").count()).isEqualTo(0);
- }
-}
\ No newline at end of file
diff --git a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/SendToCamelIT.java b/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/SendToCamelIT.java
deleted file mode 100644
index c06d824..0000000
--- a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/SendToCamelIT.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.camunda.bpm.camel.cdi;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.cdi.Uri;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.camunda.bpm.engine.runtime.ProcessInstance;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.fest.assertions.api.Assertions.assertThat;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.*;
-
-@RunWith(Arquillian.class)
-public class SendToCamelIT extends BaseArquillianIntegrationTest {
-
- private static String PROCESS_DEFINITION_KEY = "sendToCamelProcess";
-
- @Deployment
- public static WebArchive createDeployment() {
- return prepareTestDeployment(PROCESS_DEFINITION_KEY, "process/SendToCamel.bpmn20.xml");
- }
-
- @Inject
- @Uri("mock:resultEndpoint")
- MockEndpoint resultEndpoint;
-
- @Produces
- @ApplicationScoped
- public RouteBuilder createRoute() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:sendToCamelServiceTask")
- .routeId("send-to-camel-route")
- .to("log:org.camunda.bpm.camel.cdi?level=INFO&showAll=true&multiline=true")
- .to(resultEndpoint)
- ;
- }
- };
- }
-
- @Test
- public void doTest() throws InterruptedException {
- Map processVariables = new HashMap();
- processVariables.put("var1", "foo");
- processVariables.put("var2", "bar");
- ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("sendToCamelProcess", processVariables);
-
- // Verify that a process instance was executed and there are no instances executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("sendToCamelProcess").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("sendToCamelProcess").count()).isEqualTo(0);
-
- // Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(resultEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(processInstance.getId());
-
- // Assert that the body of the message received by the endpoint contains a hash map with the value of the process variable 'var1' sent from camunda BPM
- assertThat(resultEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo("{var1=foo}");
-
- // FIXME: check that var2 is also present as a property!
- }
-}
\ No newline at end of file
diff --git a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/SmokeIT.java b/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/SmokeIT.java
deleted file mode 100644
index 418c0d7..0000000
--- a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/SmokeIT.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.camunda.bpm.camel.cdi;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.cdi.Uri;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.camunda.bpm.engine.task.Task;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-
-import static org.fest.assertions.api.Assertions.assertThat;
-
-/*
- * This test is basically a ... smoke test. It's a baseline to check that all the moving pieces
- * (Maven deps, Arquillian config, ...) are working OK:
- * - process definition deployment
- * - Camel context instantiation and route startup
- * - ...
- *
- * See other tests in this package for actual exercising of the camunda BPM <-> Camel integration
- */
-@RunWith(Arquillian.class)
-public class SmokeIT extends BaseArquillianIntegrationTest {
-
- private static String PROCESS_DEFINITION_KEY = "smokeTestProcess";
-
- @Deployment
- public static WebArchive createDeployment() {
- return prepareTestDeployment(PROCESS_DEFINITION_KEY, "process/SmokeTest.bpmn20.xml");
- }
-
- @Inject
- @Uri("resultEndpoint")
- MockEndpoint resultEndpoint;
-
- @Produces
- @ApplicationScoped
- public RouteBuilder createRoute() {
- return new RouteBuilder() {
- public void configure() {
- from("timer://smoke-message?repeatCount=1")
- .routeId("smoke-test-route")
- .to("log:org.camunda.bpm.camel.cdi?level=INFO&showAll=true&multiline=true")
- .to(resultEndpoint)
- ;
- }
- };
- }
-
- @Test
- public void doTest() throws InterruptedException {
-
- assertThat(camelContextBootstrap).isNotNull();
- assertThat(camelContextBootstrap.getCamelContext()).isNotNull();
- assertThat(camelService).isNotNull();
-
- runtimeService.startProcessInstanceByKey(PROCESS_DEFINITION_KEY);
- Task task = taskService.createTaskQuery().processDefinitionKey(PROCESS_DEFINITION_KEY).singleResult();
- assertThat(task).isNotNull();
- assertThat("My Task").isEqualTo(task.getName());
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey(PROCESS_DEFINITION_KEY).count()).isEqualTo(1);
-
- taskService.complete(task.getId());
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey(PROCESS_DEFINITION_KEY).count()).isEqualTo(0);
- resultEndpoint.expectedMessageCount(1);
- resultEndpoint.assertIsSatisfied();
- }
-}
diff --git a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/StartProcessFromRouteIT.java b/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/StartProcessFromRouteIT.java
deleted file mode 100644
index 40678fb..0000000
--- a/camunda-bpm-camel-cdi/src/test/java/org/camunda/bpm/camel/cdi/StartProcessFromRouteIT.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.camunda.bpm.camel.cdi;
-
-import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.cdi.Uri;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Produces;
-import javax.inject.Inject;
-
-import java.util.Collections;
-
-import static org.fest.assertions.api.Assertions.assertThat;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.*;
-
-@RunWith(Arquillian.class)
-public class StartProcessFromRouteIT extends BaseArquillianIntegrationTest {
-
- private static String PROCESS_DEFINITION_KEY = "startProcessFromRoute";
-
- @Deployment
- public static WebArchive createDeployment() {
- return prepareTestDeployment(PROCESS_DEFINITION_KEY, "process/StartProcessFromRoute.bpmn20.xml");
- }
-
- @Inject
- @Uri("mock:mockEndpoint")
- MockEndpoint mockEndpoint;
-
- @Inject
- @Uri("mock:processVariableEndpoint")
- MockEndpoint processVariableEndpoint;
-
- @Produces
- @ApplicationScoped
- public RouteBuilder createRoute() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:start")
- .routeId("start-process-from-route")
- .to("log:org.camunda.bpm.camel.cdi?level=INFO&showAll=true&multiline=true")
- .to("camunda-bpm://start?processDefinitionKey=startProcessFromRoute©BodyAsVariable=var1")
- .to("log:org.camunda.bpm.camel.cdi?level=INFO&showAll=true&multiline=true")
- .to(mockEndpoint)
- ;
-
- from("direct:processVariable")
- .routeId("processVariableRoute")
- .to("log:org.camunda.bpm.camel.cdi?level=INFO&showAll=true&multiline=true")
- .to(processVariableEndpoint)
- ;
- }
- };
- }
-
- @Test
- public void doTest() throws InterruptedException {
- ProducerTemplate tpl = camelContextBootstrap.getCamelContext().createProducerTemplate();
-
- String processInstanceId = (String) tpl.requestBody("direct:start", Collections.singletonMap("var1", "valueOfVar1"));
- assertThat(processInstanceId).isNotNull();
- System.out.println("Process instance ID: " + processInstanceId);
-
- // Verify that a process instance was executed and there are no instances executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(0);
-
- // Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(processInstanceId);
-
- // The body of the message comming out from the camunda-bpm: endpoint is the process instance
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo(processInstanceId);
-
- // We should receive a hash map with the value of 'var1' as the body of the message
- assertThat(processVariableEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo("{var1=valueOfVar1}");
- }
-}
\ No newline at end of file
diff --git a/camunda-bpm-camel-cdi/src/test/resources/log4j.properties b/camunda-bpm-camel-cdi/src/test/resources/log4j.properties
deleted file mode 100644
index 1a421b8..0000000
--- a/camunda-bpm-camel-cdi/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-log4j.rootLogger=INFO, CA
-
-# ConsoleAppender
-log4j.appender.CA=org.apache.log4j.ConsoleAppender
-log4j.appender.CA.layout=org.apache.log4j.PatternLayout
-log4j.appender.CA.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n
-
-#log4j.logger.org.camunda=DEBUG
-#log4j.logger.org.springframework=DEBUG
-log4j.logger.org.apache.camel=DEBUG
-log4j.logger.org.camunda.bpm.camel=DEBUG
-log4j.logger.org.camunda.bpm.camel.cdi=DEBUG
-log4j.logger.org.jboss.shrinkwrap=DEBUG
-log4j.logger.org.jboss.arquillian=DEBUG
\ No newline at end of file
diff --git a/camunda-bpm-camel-cdi/src/test/resources/logging.properties b/camunda-bpm-camel-cdi/src/test/resources/logging.properties
deleted file mode 100644
index 5da3f3e..0000000
--- a/camunda-bpm-camel-cdi/src/test/resources/logging.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-# See http://www.java-tips.org/java-se-tips/java.util.logging/how-to-configure-a-logger-default-values-with-a-properties.html
-# Specify the handlers to create in the root logger
-# (all loggers are children of the root logger)
-# The following creates two handlers
-handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
-
-# Set the default logging level for the root logger
-.level = ALL
-
-# Set the default logging level for new ConsoleHandler instances
-java.util.logging.ConsoleHandler.level = INFO
-
-# Set the default logging level for new FileHandler instances
-java.util.logging.FileHandler.level = ALL
-
-# Set the default formatter for new ConsoleHandler instances
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-
-# Hide the message "WARNING: Invalid metadata org.camunda.bpm.incubation:camunda-bpm-camel-common:0.1-SNAPSHOT/maven-metadata.xml"
-# See https://community.jboss.org/thread/198980
-org.jboss.shrinkwrap.resolver.impl.maven.level=SEVERE
-org.jboss.shrinkwrap.resolver.impl.maven.LogRepositoryListener=SEVERE
\ No newline at end of file
diff --git a/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogService.java b/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogService.java
index 1dbdd75..8bb8049 100644
--- a/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogService.java
+++ b/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogService.java
@@ -13,6 +13,6 @@
package org.camunda.bpm.camel.spring.util;
public interface LogService {
- public void debug(Object msg);
- public void info(Object msg);
+ void debug(Object msg);
+ void info(Object msg);
}
diff --git a/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogServiceImpl.java b/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogServiceImpl.java
index b189954..2a3724b 100644
--- a/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogServiceImpl.java
+++ b/camunda-bpm-camel-common-tests/src/main/java/org/camunda/bpm/camel/spring/util/LogServiceImpl.java
@@ -16,17 +16,16 @@
import org.slf4j.LoggerFactory;
public class LogServiceImpl implements LogService {
-
final Logger log = LoggerFactory.getLogger(this.getClass());
@Override
public void debug(Object msg) {
- log.debug("LogService: {}", msg.toString());
+ log.debug("LogService: {}", msg);
}
@Override
public void info(Object msg) {
- log.debug("LogService: {}", msg.toString());
+ log.info("LogService: {}", msg);
}
}
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/ReceiveFromCamel.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/ReceiveFromCamel.bpmn20.xml
index a8c557b..3af55b7 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/ReceiveFromCamel.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/ReceiveFromCamel.bpmn20.xml
@@ -1,6 +1,6 @@
-
-
+
+
SequenceFlow_2
@@ -8,13 +8,13 @@
SequenceFlow_1
SequenceFlow_3
-
+
SequenceFlow_2
SequenceFlow_1
-
-
-
+
+
+
SequenceFlow_3
@@ -22,38 +22,38 @@
-
+
-
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
\ No newline at end of file
+
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/SendToCamel.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/SendToCamel.bpmn20.xml
index 3580caf..48d1b35 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/SendToCamel.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/SendToCamel.bpmn20.xml
@@ -1,20 +1,20 @@
-
-
+
+
flow1
-
-
+
+
flow1
flow2
-
-
+
+
flow2
SequenceFlow_2
-
+
SequenceFlow_2
@@ -22,39 +22,39 @@
-
+
-
+
+
+
+
-
+
-
+
+
+
+
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
+
-
+
-
\ No newline at end of file
+
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/SmokeTest.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/SmokeTest.bpmn20.xml
index 25bb2ab..350f6fd 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/SmokeTest.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/SmokeTest.bpmn20.xml
@@ -1,31 +1,31 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
\ No newline at end of file
+
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask.bpmn20.xml
index e3c0d67..2746e04 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask.bpmn20.xml
@@ -1,6 +1,6 @@
-
-
+
+
SequenceFlow_0l4pbmo
@@ -37,13 +37,6 @@
-
-
-
-
-
-
-
@@ -53,53 +46,60 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask2.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask2.bpmn20.xml
index 3e76acb..7f5b7f8 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask2.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask2.bpmn20.xml
@@ -1,6 +1,6 @@
-
-
+
+
SequenceFlow_0l4pbmo
@@ -33,17 +33,10 @@
-
+
-
-
-
-
-
-
-
@@ -53,49 +46,56 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask3.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask3.bpmn20.xml
index 5372dfa..299c9a7 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask3.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask3.bpmn20.xml
@@ -1,6 +1,6 @@
-
-
+
+
SequenceFlow_0l4pbmo
@@ -33,17 +33,10 @@
-
+
-
-
-
-
-
-
-
@@ -53,49 +46,56 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask4.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask4.bpmn20.xml
index f564c74..690ae48 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask4.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/StartExternalTask4.bpmn20.xml
@@ -1,6 +1,6 @@
-
-
+
+
SequenceFlow_0l4pbmo
@@ -33,17 +33,10 @@
-
+
-
-
-
-
-
-
-
@@ -53,49 +46,56 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
-
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/camunda-bpm-camel-common-tests/src/main/resources/process/StartProcessFromRoute.bpmn20.xml b/camunda-bpm-camel-common-tests/src/main/resources/process/StartProcessFromRoute.bpmn20.xml
index 33def1d..6ec6b56 100644
--- a/camunda-bpm-camel-common-tests/src/main/resources/process/StartProcessFromRoute.bpmn20.xml
+++ b/camunda-bpm-camel-common-tests/src/main/resources/process/StartProcessFromRoute.bpmn20.xml
@@ -1,63 +1,63 @@
-
-
+
+
SequenceFlow_2
-
-
+
+
SequenceFlow_2
SequenceFlow_4
SequenceFlow_3
-
+
SequenceFlow_4
SequenceFlow_3
-
-
+
+
-
+
-
+
+
+
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
\ No newline at end of file
+
diff --git a/camunda-bpm-camel-common/pom.xml b/camunda-bpm-camel-common/pom.xml
index cc55c8f..da74e51 100644
--- a/camunda-bpm-camel-common/pom.xml
+++ b/camunda-bpm-camel-common/pom.xml
@@ -37,9 +37,8 @@
test
- junit
- junit
- ${junit.version}
+ org.junit.jupiter
+ junit-jupiter
test
@@ -48,18 +47,6 @@
${mockito.version}
test
-
- org.powermock
- powermock-module-junit4
- ${powermock.version}
- test
-
-
- org.powermock
- powermock-api-mockito2
- ${powermock.version}
- test
-
org.assertj
assertj-core
@@ -71,14 +58,12 @@
- maven-jar-plugin
+ maven-surefire-plugin
+ 2.22.2
-
- ${project.build.outputDirectory}/META-INF/MANIFEST.MF
-
+
-
org.apache.felix
maven-bundle-plugin
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelService.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelService.java
index 09aad58..53f57b2 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelService.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelService.java
@@ -31,14 +31,14 @@ public interface CamelService {
* an Camel {@link org.apache.camel.Endpoint} URI
*
* @exception Exception BpmnError: Raises business error in workflow allowing boundary error handling
- * Any other cheched or unchecked exception raises technical error stopping workflow at service task
+ * Any other checked or unchecked exception raises technical error stopping workflow at service task
*
* @return the result of the execution of the Camel route
*/
- public Object sendTo(String endpointUri) throws Exception;
+ Object sendTo(String endpointUri) throws Exception;
/**
- * Sends the specified process instance variables as a map to an Camel
+ * Sends the specified process instance variables as a map to a Camel
* {@link org.apache.camel.Endpoint}
*
* Example usage in a ServiceTask expression:
@@ -52,14 +52,14 @@ public interface CamelService {
* null value sends all
*
* @exception Exception BpmnError: Raises business error in workflow allowing boundary error handling
- * Any other cheched or unchecked exception raises technical error stopping workflow at service task
+ * Any other checked or unchecked exception raises technical error stopping workflow at service task
*
* @return the result of the execution of the Camel route
*/
- public Object sendTo(String endpointUri, String processVariables) throws Exception;
+ Object sendTo(String endpointUri, String processVariables) throws Exception;
/**
- * Sends the specified process instance variables as a map to an Camel
+ * Sends the specified process instance variables as a map to a Camel
* {@link org.apache.camel.Endpoint} and provide correlationId for callback
*
* Example usage in a ServiceTask expression:
@@ -77,10 +77,10 @@ public interface CamelService {
* variable which is used for correlation
*
* @exception Exception BpmnError: Raises business error in workflow allowing boundary error handling
- * Any other cheched or unchecked exception raises technical error stopping workflow at service task
+ * Any other checked or unchecked exception raises technical error stopping workflow at service task
*
* @return the result of the execution of the Camel route
*/
- public Object sendTo(String endpointUri, String processVariables,
- String correlationKey) throws Exception;
+ Object sendTo(String endpointUri, String processVariables, String correlationKey)
+ throws Exception;
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelServiceCommonImpl.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelServiceCommonImpl.java
index c8918da..541cf53 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelServiceCommonImpl.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamelServiceCommonImpl.java
@@ -24,8 +24,6 @@
import java.util.Map;
import java.util.Set;
-import javax.management.RuntimeErrorException;
-
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangePattern;
@@ -60,7 +58,7 @@ public Object sendTo(String endpointUri, String processVariables,
String correlationId) throws Exception {
Collection vars;
if (processVariables == null) {
- vars = new LinkedList();
+ vars = new LinkedList<>();
ActivityExecution execution = Context.getBpmnExecutionContext()
.getExecution();
final Set variableNames = execution.getVariableNames();
@@ -69,7 +67,7 @@ public Object sendTo(String endpointUri, String processVariables,
vars.add(variableName + "?");
}
}
- } else if ("".equals(processVariables)) {
+ } else if (processVariables.isEmpty()) {
vars = Collections.emptyList();
} else {
vars = Arrays.asList(processVariables.split("\\s*,\\s*"));
@@ -77,58 +75,61 @@ public Object sendTo(String endpointUri, String processVariables,
return sendToInternal(endpointUri, vars, correlationId);
}
- private Object sendToInternal(String endpointUri,
+ private Object sendToInternal(
+ String endpointUri,
Collection variables, String correlationKey) throws Exception {
- ActivityExecution execution = (ActivityExecution) Context
- .getBpmnExecutionContext().getExecution();
- Map variablesToSend = new HashMap();
- for (String var : variables) {
+ ActivityExecution execution = Context.getBpmnExecutionContext().getExecution();
+ Map variablesToSend = new HashMap<>();
+ for (String variable : variables) {
Object value;
- if (var.endsWith("?")) {
- value = execution.getVariable(var.substring(0, var.length() - 1));
+ if (variable.endsWith("?")) {
+ value = execution.getVariable(variable.substring(0, variable.length() - 1));
} else {
- value = execution.getVariable(var);
+ value = execution.getVariable(variable);
if (value == null) {
- throw new IllegalArgumentException("Process variable '" + var
- + "' no found!");
+ throw new IllegalArgumentException("Process variable '" + variable + "' no found!");
}
}
- variablesToSend.put(var, value);
+ variablesToSend.put(variable, value);
}
- log.debug("Sending process variables '{}' as a map to Camel endpoint '{}'",
- variablesToSend, endpointUri);
- ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
- String businessKey = execution.getBusinessKey();
+ log.debug(
+ "Sending process variables '{}' as a map to Camel endpoint '{}'",
+ variablesToSend,
+ endpointUri);
+ try (ProducerTemplate producerTemplate = camelContext.createProducerTemplate()) {
+ String businessKey = execution.getBusinessKey();
+
+ Exchange exchange = new DefaultExchange(camelContext);
+ exchange.setProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID, execution.getProcessInstanceId());
+ if (businessKey != null) {
+ exchange.setProperty(EXCHANGE_HEADER_BUSINESS_KEY, businessKey);
+ }
+ if (correlationKey != null) {
+ exchange.setProperty(EXCHANGE_HEADER_CORRELATION_KEY, correlationKey);
+ }
+ exchange.getIn().setBody(variablesToSend);
+ exchange.setPattern(ExchangePattern.InOut);
+ Exchange send = producerTemplate.send(endpointUri, exchange);
+
+ // Exception handling
+ // Propagate BpmnError back from camel route,
+ // all other exceptions will cause workflow to stop as a technical error
+ // https://docs.camunda.org/get-started/rpa/error-handling/
+ // https://docs.camunda.org/manual/7.15/reference/bpmn20/events/error-events/
+ if (null != send.getException()) {
+ // Explicit BPMN business error, workflow has a chance to handle on boundary event, throw as is
+ // Note that this can terminate a process instance if no handling is defined in the model (https://docs.camunda.org/manual/latest/user-guide/process-engine/delegation-code/#throw-bpmn-errors-from-listeners)
+ if (send.getException() instanceof BpmnError) {
+ throw send.getException();
+ }
- Exchange exchange = new DefaultExchange(camelContext);
- exchange.setProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID,
- execution.getProcessInstanceId());
- if (businessKey != null) {
- exchange.setProperty(EXCHANGE_HEADER_BUSINESS_KEY, businessKey);
- }
- if (correlationKey != null) {
- exchange.setProperty(EXCHANGE_HEADER_CORRELATION_KEY, correlationKey);
- }
- exchange.getIn().setBody(variablesToSend);
- exchange.setPattern(ExchangePattern.InOut);
- Exchange send = producerTemplate.send(endpointUri, exchange);
-
- // Exception handling
- // Propogate BpmnError back from camel route,
- // all other exceptions will cause workflow to stop as a technical error
- // https://docs.camunda.org/get-started/rpa/error-handling/
- // https://docs.camunda.org/manual/7.15/reference/bpmn20/events/error-events/
- if (null != send.getException()){
- // Explicit BPMN business error, workflow has a chance to handle on boundry event, throw as is
- // Note that this can terminate a process instance if no handling is defined in the model (https://docs.camunda.org/manual/latest/user-guide/process-engine/delegation-code/#throw-bpmn-errors-from-listeners)
- if (send.getException() instanceof BpmnError) throw ((BpmnError)send.getException());
-
- // otherwise simply throw the exception, leads to incident in process instance
- throw send.getException();
- }
+ // otherwise simply throw the exception, leads to incident in process instance
+ throw send.getException();
+ }
- return send.getIn().getBody();
+ return send.getIn().getBody();
+ }
}
public abstract void setProcessEngine(ProcessEngine processEngine);
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamundaUtils.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamundaUtils.java
index b585ae9..df538ff 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamundaUtils.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/CamundaUtils.java
@@ -17,17 +17,19 @@
import org.camunda.bpm.engine.OptimisticLockingException;
public class CamundaUtils {
+ private static final long SLEEP_IN_MS = 250;
+ private static final int DEFAULT_TIMES = 1000;
- private static long sleepInMs = 250;
- private static int defaultTimes = 1000;
+ private CamundaUtils() {
+ throw new UnsupportedOperationException("This class cannot be instantiated");
+ }
public static V retryIfOptimisticLockingException(final Callable action) {
- return retryIfOptimisticLockingException(defaultTimes, action);
+ return retryIfOptimisticLockingException(DEFAULT_TIMES, action);
}
public static V retryIfOptimisticLockingException(int times, final Callable action) {
-
- OptimisticLockingException lastException = null;
+ OptimisticLockingException lastException;
do {
try {
return action.call();
@@ -41,25 +43,15 @@ public static V retryIfOptimisticLockingException(int times, final Callable<
}
try {
- Thread.sleep(sleepInMs);
+ Thread.sleep(SLEEP_IN_MS);
} catch (InterruptedException e) {
- // never minde
+ // never mind
}
} while (times > 0);
-
- final StringBuilder message = new StringBuilder();
- message.append("Event after ");
- message.append(times);
- message.append(" attempts (every delayed for ");
- message.append(sleepInMs);
- message.append("ms) an OptimisticLockingException is thrown!");
- if (lastException != null) {
- message.append(" message='");
- message.append(lastException.getMessage());
- message.append('\'');
- }
- throw new OptimisticLockingException(message.toString());
-
+ throw new OptimisticLockingException(
+ "Event after " + times + " attempts (every delayed for " + SLEEP_IN_MS + "ms)" +
+ " an OptimisticLockingException is thrown!" +
+ " message='" + lastException.getMessage() + '\'');
}
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/ExchangeUtils.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/ExchangeUtils.java
index d256d93..5e47aae 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/ExchangeUtils.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/ExchangeUtils.java
@@ -28,9 +28,12 @@
* @author Bernd Ruecker
*/
public class ExchangeUtils {
-
private static final Logger LOG = LoggerFactory.getLogger(ExchangeUtils.class);
+ private ExchangeUtils() {
+ throw new UnsupportedOperationException("This class cannot be instantiated");
+ }
+
/**
* Copies variables from Camel into the process engine.
*
@@ -44,16 +47,13 @@ public class ExchangeUtils {
* The Camel Exchange object
* @param parameters
* Parameters as defined in the docs
- * @return A Map containing all of the variables to be used
+ * @return A Map containing all the variables to be used
* in the process engine
*/
- @SuppressWarnings("rawtypes")
public static Map prepareVariables(Exchange exchange, Map parameters) {
- Map processVariables = new HashMap();
-
+ Map processVariables = new HashMap<>();
Object camelBody = exchange.getIn().getBody();
if (camelBody instanceof String) {
-
// If the COPY_MESSAGE_BODY_AS_PROCESS_VARIABLE_PARAMETER was passed
// the value of it
// is taken as variable to store the (string) body in
@@ -62,22 +62,18 @@ public static Map prepareVariables(Exchange exchange, Map) {
-
- Map, ?> camelBodyMap = (Map, ?>) camelBody;
- for (Map.Entry e : camelBodyMap.entrySet()) {
+ } else if (camelBody instanceof Map, ?> camelBodyMap) {
+ for (Map.Entry, ?> e : camelBodyMap.entrySet()) {
if (e.getKey() instanceof String) {
processVariables.put((String) e.getKey(), e.getValue());
}
}
-
- } else if (camelBody != null) {
- LOG.warn("unkown type of camel body - not handed over to process engine: " + camelBody.getClass());
+ } else if (camelBody != null && LOG.isWarnEnabled()) {
+ LOG.warn(
+ "unknown type of camel body - not handed over to process engine: {}",
+ camelBody.getClass());
}
-
return processVariables;
}
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/UriUtils.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/UriUtils.java
index f1f35d0..4e0c10d 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/UriUtils.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/common/UriUtils.java
@@ -28,17 +28,13 @@ public static class ParsedUri {
* or component prefix
*/
public ParsedUri(final String remainingUri) {
-
this.remainingUri = remainingUri;
-
components = parseUri(remainingUri);
- if ((components == null) || (components.length == 0)) {
+ if (components.length == 0) {
throw new RuntimeException("Cannot create a producer for URI '" + remainingUri + "'");
}
-
final String identifier = components[0];
type = UriType.typeByIdentifier(identifier);
-
}
public String[] getComponents() {
@@ -48,7 +44,6 @@ public String[] getComponents() {
public UriType getType() {
return type;
}
-
/**
* @return the remaining part of the URI without the query parameters or
* component prefix
@@ -56,38 +51,33 @@ public UriType getType() {
public String getRemainingUri() {
return remainingUri;
}
-
}
public enum UriType {
+ START_PR("start"),
+ SEND_SIGNAL("signal"),
+ SEND_MESSAGE("message"),
+ POLL_EXTERNAL_TASKS("poll-externalTasks"),
+ PROCESS_EXTERNAL_TASK("async-externalTask");
- StartProcess("start"), SendSignal("signal"), SendMessage("message"),
- PollExternalTasks("poll-externalTasks"), ProcessExternalTask("async-externalTask");
-
- private String identifier;
+ private final String identifier;
UriType(final String identifier) {
this.identifier = identifier;
}
public static UriType typeByIdentifier(final String identifier) {
-
for (final UriType type : values()) {
if (type.identifier.equals(identifier)) {
return type;
}
}
-
throw new RuntimeException("Cannot create a producer for identifier '" + identifier + "'");
-
}
- };
+ }
public static String[] parseUri(String remainingUri) {
-
return remainingUri.split("/");
-
}
-
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmComponent.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmComponent.java
index 2af5bb0..8808799 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmComponent.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmComponent.java
@@ -29,7 +29,6 @@
* @author Rafael Cordones (@rafacm)
*/
public class CamundaBpmComponent extends DefaultComponent {
-
final Logger log = LoggerFactory.getLogger(CamundaBpmComponent.class);
protected ProcessEngine processEngine;
@@ -49,18 +48,15 @@ public void close() {
}
@Override
- protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
-
+ protected Endpoint createEndpoint(String uri, String remaining, Map parameters) {
final ParsedUri parsedUri = new ParsedUri(remaining);
- switch (parsedUri.getType()) {
- case PollExternalTasks:
- return new CamundaBpmPollExternalTasksEndpointImpl(uri, this, parameters);
- case ProcessExternalTask:
- return new CamundaBpmProcessExternalTaskEndpointImpl(uri, this, parameters);
- default:
- return new CamundaBpmEndpointDefaultImpl(uri, parsedUri, this, parameters);
- }
-
+ return switch (parsedUri.getType()) {
+ case POLL_EXTERNAL_TASKS ->
+ new CamundaBpmPollExternalTasksEndpointImpl(uri, this, parameters);
+ case PROCESS_EXTERNAL_TASK ->
+ new CamundaBpmProcessExternalTaskEndpointImpl(uri, this, parameters);
+ default -> new CamundaBpmEndpointDefaultImpl(uri, parsedUri, this, parameters);
+ };
}
public ProcessEngine getProcessEngine() {
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmConstants.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmConstants.java
index 2aa1385..e1a5d53 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmConstants.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmConstants.java
@@ -33,34 +33,35 @@ public final class CamundaBpmConstants {
public static final String EXCHANGE_RESPONSE_IGNORE = "CamundaBpmExternalTaskIgnore";
/* Apache Camel URI parameters */
- public final static String PROCESS_DEFINITION_KEY_PARAMETER = "processDefinitionKey";
- public final static String TOPIC_PARAMETER = "topic";
- public final static String WORKERID_PARAMETER = "workerId";
- public final static String VARIABLESTOFETCH_PARAMETER = "variablesToFetch";
- public final static String DESERIALIZEVARIABLES_PARAMETER = "deserializeVariables";
- public final static boolean DESERIALIZEVARIABLES_DEFAULT = true;
- public final static String MAXTASKSPERPOLL_PARAMETER = "maxTasksPerPoll";
- public final static int MAXTASKSPERPOLL_DEFAULT = 5;
- public final static String ASYNC_PARAMETER = "async";
- public final static boolean ASYNC_DEFAULT = false;
- public final static String ONCOMPLETION_PARAMETER = "onCompletion";
- public final static boolean ONCOMPLETION_DEFAULT = false;
- public final static String LOCKDURATION_PARAMETER = "lockDuration";
- public final static long LOCKDURATION_DEFAULT = 60000;
- public final static String RETRIES_PARAMETER = "retries";
- public final static String RETRYTIMEOUT_PARAMETER = "retryTimeout";
- public final static long RETRYTIMEOUT_DEFAULT = 500;
- public final static String RETRYTIMEOUTS_PARAMETER = "retryTimeouts";
- public final static String MESSAGE_NAME_PARAMETER = "messageName";
- public final static String CORRELATION_KEY_NAME_PARAMETER = "correlationKeyName";
- public final static String ACTIVITY_ID_PARAMETER = "activityId";
- public final static String COPY_MESSAGE_PROPERTIES_PARAMETER = "copyProperties";
- public final static String COPY_MESSAGE_HEADERS_PARAMETER = "copyHeaders";
- public final static String COPY_MESSAGE_BODY_AS_PROCESS_VARIABLE_PARAMETER = "copyBodyAsVariable";
- public final static String COPY_PROCESS_VARIABLES_TO_OUT_BODY_PARAMETER = "copyVariablesToOutBody";
+ public static final String PROCESS_DEFINITION_KEY_PARAMETER = "processDefinitionKey";
+ public static final String TOPIC_PARAMETER = "topic";
+ public static final String WORKERID_PARAMETER = "workerId";
+ public static final String VARIABLESTOFETCH_PARAMETER = "variablesToFetch";
+ public static final String DESERIALIZEVARIABLES_PARAMETER = "deserializeVariables";
+ public static final boolean DESERIALIZEVARIABLES_DEFAULT = true;
+ public static final String MAXTASKSPERPOLL_PARAMETER = "maxTasksPerPoll";
+ public static final int MAXTASKSPERPOLL_DEFAULT = 5;
+ public static final String ASYNC_PARAMETER = "async";
+ public static final boolean ASYNC_DEFAULT = false;
+ public static final String ONCOMPLETION_PARAMETER = "onCompletion";
+ public static final boolean ONCOMPLETION_DEFAULT = false;
+ public static final String LOCKDURATION_PARAMETER = "lockDuration";
+ public static final long LOCKDURATION_DEFAULT = 60000;
+ public static final String RETRIES_PARAMETER = "retries";
+ public static final String RETRYTIMEOUT_PARAMETER = "retryTimeout";
+ public static final long RETRYTIMEOUT_DEFAULT = 500;
+ public static final String RETRYTIMEOUTS_PARAMETER = "retryTimeouts";
+ public static final String MESSAGE_NAME_PARAMETER = "messageName";
+ public static final String CORRELATION_KEY_NAME_PARAMETER = "correlationKeyName";
+ public static final String ACTIVITY_ID_PARAMETER = "activityId";
+ public static final String COPY_MESSAGE_PROPERTIES_PARAMETER = "copyProperties";
+ public static final String COPY_MESSAGE_HEADERS_PARAMETER = "copyHeaders";
+ public static final String COPY_MESSAGE_BODY_AS_PROCESS_VARIABLE_PARAMETER = "copyBodyAsVariable";
+ public static final String COPY_PROCESS_VARIABLES_TO_OUT_BODY_PARAMETER = "copyVariablesToOutBody";
private CamundaBpmConstants() {
- } // prevent instantiation of helper class
+ throw new UnsupportedOperationException("This class cannot be instantiated");
+ }
public static String camundaBpmUri(String path) {
return CAMUNDA_BPM_CAMEL_URI_SCHEME + ":" + path;
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpoint.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpoint.java
index b24bad6..a6d97ef 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpoint.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpoint.java
@@ -16,7 +16,5 @@
import org.camunda.bpm.engine.ProcessEngine;
public interface CamundaBpmEndpoint extends Endpoint {
-
ProcessEngine getProcessEngine();
-
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpointDefaultImpl.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpointDefaultImpl.java
index 57fcad1..7adb9c6 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpointDefaultImpl.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmEndpointDefaultImpl.java
@@ -35,11 +35,10 @@
* @author Ryan Johnston (@rjfsu), Tijs Rademakers
*/
public class CamundaBpmEndpointDefaultImpl extends DefaultEndpoint implements CamundaBpmEndpoint {
-
private static final Logger LOG = LoggerFactory.getLogger(CamundaBpmEndpointDefaultImpl.class);
- private CamundaBpmComponent component;
- private Map parameters;
+ private final CamundaBpmComponent component;
+ private final Map parameters;
private final ParsedUri uri;
public CamundaBpmEndpointDefaultImpl(String uri, ParsedUri parsedUri, CamundaBpmComponent component,
@@ -54,14 +53,15 @@ public ProcessEngine getProcessEngine() {
return this.component.getProcessEngine();
}
- public Producer createProducer() throws Exception {
+ public Producer createProducer() {
return CamundaBpmProducerFactory.createProducer(this, this.uri, this.parameters);
}
- public Consumer createConsumer(Processor processor) throws Exception {
+ public Consumer createConsumer(Processor processor) {
return null;
}
+ @Override
public boolean isSingleton() {
return true;
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmPollExternalTasksEndpointImpl.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmPollExternalTasksEndpointImpl.java
index a2b7f46..3771915 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmPollExternalTasksEndpointImpl.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmPollExternalTasksEndpointImpl.java
@@ -45,11 +45,10 @@
import org.slf4j.LoggerFactory;
public class CamundaBpmPollExternalTasksEndpointImpl extends DefaultPollingEndpoint implements CamundaBpmEndpoint {
-
private static final Logger LOG = LoggerFactory.getLogger(
CamundaBpmPollExternalTasksEndpointImpl.class.getCanonicalName());
- private CamundaBpmComponent component;
+ private final CamundaBpmComponent component;
// parameters
private final String topic;
@@ -65,11 +64,8 @@ public class CamundaBpmPollExternalTasksEndpointImpl extends DefaultPollingEndpo
public CamundaBpmPollExternalTasksEndpointImpl(final String endpointUri, final CamundaBpmComponent component,
final Map parameters) {
-
super(endpointUri, component);
-
this.component = component;
-
if (parameters.containsKey(TOPIC_PARAMETER)) {
this.topic = (String) parameters.remove(TOPIC_PARAMETER);
} else {
@@ -127,7 +123,7 @@ public CamundaBpmPollExternalTasksEndpointImpl(final String endpointUri, final C
if (parameters.containsKey(VARIABLESTOFETCH_PARAMETER)) {
final String variables = (String) parameters.remove(VARIABLESTOFETCH_PARAMETER);
if (variables.trim().isEmpty()) {
- variablesToFetch = new LinkedList();
+ variablesToFetch = new LinkedList<>();
} else {
variablesToFetch = StringUtil.splitListBySeparator(variables, ",");
}
@@ -146,7 +142,6 @@ public CamundaBpmPollExternalTasksEndpointImpl(final String endpointUri, final C
} else {
this.deserializeVariables = DESERIALIZEVARIABLES_DEFAULT;
}
-
}
@Override
@@ -157,7 +152,6 @@ public void close() {
@Override
public Consumer createConsumer(Processor processor) throws Exception {
-
final BatchConsumer consumer;
if (getScheduledExecutorService() != null) {
consumer = new BatchConsumer(this,
@@ -189,38 +183,25 @@ public Consumer createConsumer(Processor processor) throws Exception {
consumer.setMaxMessagesPerPoll(maxTasksPerPoll);
return consumer;
-
}
@Override
- public PollingConsumer createPollingConsumer() throws Exception {
-
+ public PollingConsumer createPollingConsumer() {
return null;
- // return new
- // org.camunda.bpm.camel.component.externaltasks.PollingConsumer(this,
- // topic);
-
}
@Override
- public Producer createProducer() throws Exception {
-
+ public Producer createProducer() {
return null;
-
}
@Override
public boolean isSingleton() {
-
return true;
-
}
@Override
public ProcessEngine getProcessEngine() {
-
return component.getProcessEngine();
-
}
-
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmProcessExternalTaskEndpointImpl.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmProcessExternalTaskEndpointImpl.java
index 09949fd..6e9f0e7 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmProcessExternalTaskEndpointImpl.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/CamundaBpmProcessExternalTaskEndpointImpl.java
@@ -30,13 +30,12 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class CamundaBpmProcessExternalTaskEndpointImpl extends ProcessorEndpoint implements
- CamundaBpmEndpoint {
-
+public class CamundaBpmProcessExternalTaskEndpointImpl extends ProcessorEndpoint
+ implements CamundaBpmEndpoint {
private static final Logger LOG = LoggerFactory.getLogger(
CamundaBpmProcessExternalTaskEndpointImpl.class);
- private CamundaBpmComponent component;
+ private final CamundaBpmComponent component;
// parameters
private final String topic;
@@ -49,9 +48,7 @@ public class CamundaBpmProcessExternalTaskEndpointImpl extends ProcessorEndpoint
public CamundaBpmProcessExternalTaskEndpointImpl(final String endpointUri,
final CamundaBpmComponent component,
final Map parameters) {
-
super(endpointUri, component);
-
this.component = component;
if (parameters.containsKey(TOPIC_PARAMETER)) {
@@ -95,14 +92,11 @@ public CamundaBpmProcessExternalTaskEndpointImpl(final String endpointUri,
} else {
this.workerId = null;
}
-
}
@Override
public boolean isSingleton() {
-
return true;
-
}
@Override
@@ -113,17 +107,20 @@ public void close() {
@Override
public ProcessEngine getProcessEngine() {
-
return component.getProcessEngine();
-
}
@Override
- protected Processor createProcessor() throws Exception {
-
- return new TaskProcessor(this, topic, retries, retryTimeout, retryTimeouts, true, onCompletion,
+ protected Processor createProcessor() {
+ return new TaskProcessor(
+ this,
+ topic,
+ retries,
+ retryTimeout,
+ retryTimeouts,
+ true,
+ onCompletion,
workerId);
-
}
}
diff --git a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/externaltasks/BatchConsumer.java b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/externaltasks/BatchConsumer.java
index 0c2d3c7..f2ae896 100644
--- a/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/externaltasks/BatchConsumer.java
+++ b/camunda-bpm-camel-common/src/main/java/org/camunda/bpm/camel/component/externaltasks/BatchConsumer.java
@@ -19,11 +19,9 @@
import static org.camunda.bpm.camel.component.CamundaBpmConstants.EXCHANGE_HEADER_TASK;
import java.lang.reflect.Method;
-import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
-import java.util.concurrent.Callable;
import java.util.concurrent.ScheduledExecutorService;
import org.apache.camel.*;
@@ -55,14 +53,12 @@ public class BatchConsumer extends ScheduledBatchPollingConsumer {
private final TaskProcessor taskProcessor;
static {
-
try {
deserializeVariablesMethod = ExternalTaskQueryTopicBuilder.class.getMethod(
"enableCustomObjectDeserialization");
} catch (Exception e) {
// ignore because the Camunda version below 7.6.0 is used
}
-
}
public static boolean systemKnowsDeserializationOfVariables() {
@@ -73,9 +69,7 @@ public BatchConsumer(final CamundaBpmEndpoint endpoint, final Processor processo
final long retryTimeout, final long[] retryTimeouts, final long lockDuration, final String topic,
final boolean completeTask, final List variablesToFetch, final boolean deserializeVariables,
final String workerId) {
-
super(endpoint, processor);
-
this.camundaEndpoint = endpoint;
this.lockDuration = lockDuration;
this.topic = topic;
@@ -83,7 +77,6 @@ public BatchConsumer(final CamundaBpmEndpoint endpoint, final Processor processo
this.variablesToFetch = variablesToFetch;
this.deserializeVariables = deserializeVariables;
this.workerId = workerId;
-
this.taskProcessor = new TaskProcessor(endpoint,
topic,
retries,
@@ -92,16 +85,13 @@ public BatchConsumer(final CamundaBpmEndpoint endpoint, final Processor processo
completeTask,
true,
workerId);
-
}
public BatchConsumer(final CamundaBpmEndpoint endpoint, final Processor processor,
final ScheduledExecutorService executor, final int retries, final long retryTimeout,
final long[] retryTimeouts, final long lockDuration, final String topic, final boolean completeTask,
final List variablesToFetch, final boolean deserializeVariables, final String workerId) {
-
super(endpoint, processor, executor);
-
this.camundaEndpoint = endpoint;
this.lockDuration = lockDuration;
this.topic = topic;
@@ -109,7 +99,6 @@ public BatchConsumer(final CamundaBpmEndpoint endpoint, final Processor processo
this.variablesToFetch = variablesToFetch;
this.deserializeVariables = deserializeVariables;
this.workerId = workerId;
-
this.taskProcessor = new TaskProcessor(endpoint,
topic,
retries,
@@ -118,7 +107,6 @@ public BatchConsumer(final CamundaBpmEndpoint endpoint, final Processor processo
completeTask,
true,
workerId);
-
}
@Override
@@ -129,13 +117,12 @@ public void close() {
@Override
public int processBatch(Queue
- junit
- junit
- ${junit.version}
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
+
+
+ org.junit.vintage
+ junit-vintage-engine
test
@@ -167,12 +173,12 @@
jakarta.xml.bind
jakarta.xml.bind-api
- 2.3.2
+ 4.0.1
org.glassfish.jaxb
jaxb-runtime
- 2.3.2
+ 4.0.5
diff --git a/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/CamelServiceImpl.java b/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/CamelServiceImpl.java
index 7be992d..d31f3ea 100644
--- a/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/CamelServiceImpl.java
+++ b/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/CamelServiceImpl.java
@@ -15,16 +15,24 @@
import org.apache.camel.CamelContext;
import org.camunda.bpm.camel.common.CamelServiceCommonImpl;
import org.camunda.bpm.engine.ProcessEngine;
-import org.springframework.beans.factory.annotation.Required;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+@Service
public class CamelServiceImpl extends CamelServiceCommonImpl {
- @Required
+ @Autowired
+ public CamelServiceImpl(ProcessEngine processEngine, CamelContext camelContext) {
+ setProcessEngine(processEngine);
+ setCamelContext(camelContext);
+ }
+
+ @Override
public void setProcessEngine(ProcessEngine processEngine) {
this.processEngine = processEngine;
}
- @Required
+ @Override
public void setCamelContext(CamelContext camelContext) {
this.camelContext = camelContext;
}
diff --git a/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/SpringCamundaBpmComponent.java b/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/SpringCamundaBpmComponent.java
index ed5da6e..3585cab 100644
--- a/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/SpringCamundaBpmComponent.java
+++ b/camunda-bpm-camel-spring/src/main/java/org/camunda/bpm/camel/spring/SpringCamundaBpmComponent.java
@@ -15,11 +15,13 @@
import org.camunda.bpm.camel.component.CamundaBpmComponent;
import org.camunda.bpm.engine.ProcessEngine;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+@Service
public class SpringCamundaBpmComponent extends CamundaBpmComponent {
@Autowired
- public void setProcessEngine(ProcessEngine processEngine) {
- super.setProcessEngine(processEngine);
+ public SpringCamundaBpmComponent(ProcessEngine processEngine) {
+ super(processEngine);
}
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ConsumeExternalTasksTest.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ConsumeExternalTasksTest.java
index 917c3e0..437f6c0 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ConsumeExternalTasksTest.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ConsumeExternalTasksTest.java
@@ -13,11 +13,6 @@
* limitations under the License.
*/
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.EXCHANGE_HEADER_ATTEMPTSSTARTED;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.EXCHANGE_HEADER_RETRIESLEFT;
-
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -26,7 +21,6 @@
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Expression;
-import org.apache.camel.Processor;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
import org.assertj.core.api.Assertions;
@@ -42,7 +36,6 @@
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.test.Deployment;
import org.camunda.bpm.engine.test.ProcessEngineRule;
-import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
@@ -55,7 +48,6 @@
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:consume-external-tasks-config.xml")
public class ConsumeExternalTasksTest {
-
@SetExternalTaskRetries(retries = 0)
public static class CreateIncidentException extends Exception {
private static final long serialVersionUID = 1L;
@@ -63,7 +55,7 @@ public static class CreateIncidentException extends Exception {
public CreateIncidentException(final String message) {
super(message);
}
- };
+ }
@SetExternalTaskRetries(retries = 0, relative = true)
public static class DontChangeRetriesException extends Exception {
@@ -72,52 +64,36 @@ public static class DontChangeRetriesException extends Exception {
public DontChangeRetriesException(final String message) {
super(message);
}
- };
+ }
private MockEndpoint mockEndpoint;
- @Autowired(required = true)
+ @Autowired
private CamelContext camelContext;
- @Autowired(required = true)
+ @Autowired
private RuntimeService runtimeService;
- @Autowired(required = true)
+ @Autowired
private HistoryService historyService;
- @Autowired(required = true)
+ @Autowired
private ExternalTaskService externalTaskService;
- @Autowired(required = true)
+ @Autowired
@Rule
public ProcessEngineRule processEngineRule;
@Before
- public void setUp() throws Exception {
-
+ public void setUp() {
mockEndpoint = (MockEndpoint) camelContext.getEndpoint("mock:endpoint");
mockEndpoint.reset();
-
- // start consumer if stopped by previous test (see "tearDown()")
- // ((BatchConsumer)
- // camelContext.getRoute("firstRoute").getConsumer()).start();
-
}
- @After
- public void tearDown() throws Exception {
-
- // avoid accessing during shutdown of Camunda engine
- // ((BatchConsumer)
- // camelContext.getRoute("firstRoute").getConsumer()).stop();
-
- }
-
- @SuppressWarnings("unchecked")
@Test
@Deployment(resources = { "process/StartExternalTask.bpmn20.xml" })
+ @SuppressWarnings("unchecked")
public void testSetProcessVariables() throws Exception {
-
// variables to be set by the Camel-endpoint processing the external
// task
mockEndpoint.returnReplyBody(new Expression() {
@@ -126,20 +102,21 @@ public T evaluate(Exchange exchange, Class type) {
Map variables = exchange.getIn().getBody(Map.class);
final String var2 = (String) variables.get("var2");
- final HashMap result = new HashMap();
+ final HashMap result = new HashMap<>();
result.put("var2", var2 + "bar");
result.put("var3", "bar3");
+
return (T) result;
}
});
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// wait for the external task to be completed
Thread.sleep(1000);
@@ -147,65 +124,78 @@ public T evaluate(Exchange exchange, Class type) {
// external task is not open any more
final long externalTasksCount = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).active().count();
- assertThat(externalTasksCount).isEqualTo(0);
+ Assertions.assertThat(externalTasksCount).isZero();
// assert that the camunda BPM process instance ID has been added as a
// property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(
- processInstance.getId());
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
// all process instance variables are loaded since no "variablesToFetch"
// parameter was given
var exchangeIn = mockEndpoint.assertExchangeReceived(0).getIn();
- assertThat(exchangeIn.getBody()).isNotNull();
- assertThat(exchangeIn.getBody()).isInstanceOf(Map.class);
- assertThat(exchangeIn.getBody(Map.class)).hasSize(2);
- assertThat(exchangeIn.getBody(Map.class)).containsKey("var1");
- assertThat(exchangeIn.getBody(Map.class)).containsKey("var2");
- assertThat(exchangeIn.getBody(Map.class)).containsValue("foo");
- assertThat(exchangeIn.getBody(Map.class)).containsValue("bar");
+ Assertions.assertThat(exchangeIn.getBody()).isNotNull();
+ Assertions.assertThat(exchangeIn.getBody()).isInstanceOf(Map.class);
+ Assertions.assertThat(exchangeIn.getBody(Map.class)).hasSize(2);
+ Assertions.assertThat(exchangeIn.getBody(Map.class)).containsEntry("var1", "foo");
+ Assertions.assertThat(exchangeIn.getBody(Map.class)).containsEntry("var2", "bar");
// assert that the variables sent in the response-message has been set
// into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(3);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(3);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("barbar");
- assertThat(variablesAsMap.containsKey("var3")).isTrue();
- assertThat(variablesAsMap.get("var3")).isEqualTo("bar3");
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "barbar")
+ .containsEntry("var3", "bar3");
// assert that process in end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNotNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNotNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
-
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
}
- @SuppressWarnings("unchecked")
@Test
@Deployment(resources = { "process/StartExternalTask3.bpmn20.xml" })
+ @SuppressWarnings("unchecked")
public void testLoadNoProcessVariablesAndAsyncIsFalse() throws Exception {
-
// variables to be set by the Camel-endpoint processing the external
// task
mockEndpoint.returnReplyBody(new Expression() {
@Override
+ @SuppressWarnings("unchecked")
public T evaluate(Exchange exchange, Class type) {
- final HashMap result = new HashMap();
+ final HashMap result = new HashMap<>();
result.put("var1", "foo1");
result.put("var2", "bar2");
return (T) result;
@@ -213,12 +203,12 @@ public T evaluate(Exchange exchange, Class type) {
});
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess3",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// wait for the external task to be completed
Thread.sleep(1000);
@@ -226,58 +216,79 @@ public T evaluate(Exchange exchange, Class type) {
// external task is not open any more
final long externalTasksCount = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).active().count();
- assertThat(externalTasksCount).isEqualTo(0);
+ Assertions.assertThat(externalTasksCount).isZero();
// assert that the camunda BPM process instance ID has been added as a
// property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(
- processInstance.getId());
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
// no process instance variables are loaded since an empty
// "variablesToFetch" parameter was given
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody()).isNotNull();
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody()).isInstanceOf(Map.class);
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class).size()).isEqualTo(0);
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody())
+ .isNotNull()
+ .isInstanceOf(Map.class);
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(Map.class))
+ .isEmpty();
// assert that the variables sent in the response-message has been set
// into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(2);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(2);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo1");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar2");
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo1")
+ .containsEntry("var2", "bar2");
// assert that process in end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNotNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNotNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
-
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
}
- @SuppressWarnings("unchecked")
@Test
@Deployment(resources = { "process/StartExternalTask4.bpmn20.xml" })
- public void testCompleteTaskOnCompletionSucessfully() throws Exception {
-
+ public void testCompleteTaskOnCompletionSuccessfully() {
// variables returned but must not be set since task will not be
// completed
mockEndpoint.returnReplyBody(new Expression() {
@Override
+ @SuppressWarnings("unchecked")
public T evaluate(Exchange exchange, Class type) {
- final HashMap result = new HashMap();
+ final HashMap result = new HashMap<>();
result.put("var2", "bar2");
result.put("var3", "bar3");
return (T) result;
@@ -285,26 +296,28 @@ public T evaluate(Exchange exchange, Class type) {
});
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
processVariables.put("var3", "foobar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess2",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// external task is still not resolved and not locked
final List externalTasks1 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks1).isNotNull();
- assertThat(externalTasks1.size()).isEqualTo(1);
- assertThat(externalTasks1.get(0).getWorkerId()).isNull();
+ Assertions.assertThat(externalTasks1)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks1.get(0).getWorkerId()).isNull();
// find external task and lock
final List locked = externalTaskService.fetchAndLock(1, "0815", true).topic("topic4",
5000).execute();
- assertThat(locked).isNotNull();
- assertThat(locked.size()).isEqualTo(1);
+ Assertions.assertThat(locked)
+ .isNotNull()
+ .hasSize(1);
final LockedExternalTask lockedExternalTask = locked.get(0);
// call route "direct:testRoute"
@@ -315,78 +328,97 @@ public T evaluate(Exchange exchange, Class type) {
lockedExternalTask.getId());
// ensure endpoint has been called
- assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getHeader(EXCHANGE_HEADER_ATTEMPTSSTARTED)).isEqualTo(
- 0);
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getHeader(EXCHANGE_HEADER_RETRIESLEFT)).isEqualTo(2);
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getHeader(CamundaBpmConstants.EXCHANGE_HEADER_ATTEMPTSSTARTED))
+ .isEqualTo(0);
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getHeader(CamundaBpmConstants.EXCHANGE_HEADER_RETRIESLEFT))
+ .isEqualTo(2);
// assert that process in end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNotNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNotNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
// assert that the variables sent in the response-message has been set
// into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(3);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(3);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar2");
- assertThat(variablesAsMap.containsKey("var3")).isTrue();
- assertThat(variablesAsMap.get("var3")).isEqualTo("bar3");
-
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar2")
+ .containsEntry("var3", "bar3");
}
@Test
@Deployment(resources = { "process/StartExternalTask4.bpmn20.xml" })
- public void testCompleteTaskOnCompletionFailure() throws Exception {
-
+ public void testCompleteTaskOnCompletionFailure() {
final String FAILURE = "Failure";
// variables returned but must not be set since task will not be
// completed
- mockEndpoint.whenAnyExchangeReceived(new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- throw new Exception(FAILURE);
- }
+ mockEndpoint.whenAnyExchangeReceived(exchange -> {
+ throw new Exception(FAILURE);
});
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
processVariables.put("var3", "foobar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess2",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// external task is still not resolved and not locked
final List externalTasks1 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks1).isNotNull();
- assertThat(externalTasks1.size()).isEqualTo(1);
- assertThat(externalTasks1.get(0).getWorkerId()).isNull();
- assertThat(externalTasks1.get(0).getRetries()).isNull();
+ Assertions.assertThat(externalTasks1)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks1.get(0).getWorkerId()).isNull();
+ Assertions.assertThat(externalTasks1.get(0).getRetries()).isNull();
// find external task and lock
final List locked = externalTaskService.fetchAndLock(1, "0815", true).topic("topic4",
5000).execute();
- assertThat(locked).isNotNull();
- assertThat(locked.size()).isEqualTo(1);
+ Assertions.assertThat(locked)
+ .isNotNull()
+ .hasSize(1);
final LockedExternalTask lockedExternalTask = locked.get(0);
// call route "direct:testRoute"
@@ -402,59 +434,71 @@ public void process(Exchange exchange) throws Exception {
}
// ensure endpoint has been called
- assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
// external task is still not resolved
final List externalTasks2 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks2).isNotNull();
- assertThat(externalTasks2.size()).isEqualTo(1);
- assertThat(externalTasks2.get(0).getRetries()).isEqualTo(2);
+ Assertions.assertThat(externalTasks2)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks2.get(0).getRetries()).isEqualTo(2);
// assert that process not in the end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
// assert that the variables sent in the response-message has been set
// into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(3);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(3);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar");
- assertThat(variablesAsMap.containsKey("var3")).isTrue();
- assertThat(variablesAsMap.get("var3")).isEqualTo("foobar");
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar")
+ .containsEntry("var3", "foobar");
// complete task to make test order not relevant
externalTaskService.complete(externalTasks2.get(0).getId(), "0815");
-
}
@SuppressWarnings("unchecked")
@Test
@Deployment(resources = { "process/StartExternalTask4.bpmn20.xml" })
- public void testCompleteTaskSucessfully() throws Exception {
-
+ public void testCompleteTaskSuccessfully() {
// variables returned but must not be set since task will not be
// completed
mockEndpoint.returnReplyBody(new Expression() {
@Override
public T evaluate(Exchange exchange, Class type) {
- final HashMap result = new HashMap();
+ final HashMap result = new HashMap<>();
result.put("var2", "bar2");
result.put("var3", "bar3");
return (T) result;
@@ -462,26 +506,30 @@ public T evaluate(Exchange exchange, Class type) {
});
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
processVariables.put("var3", "foobar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess2",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// external task is still not resolved and not locked
- final List externalTasks1 = externalTaskService.createExternalTaskQuery().processInstanceId(
- processInstance.getId()).list();
- assertThat(externalTasks1).isNotNull();
- assertThat(externalTasks1.size()).isEqualTo(1);
- assertThat(externalTasks1.get(0).getWorkerId()).isNull();
+ final List externalTasks1 = externalTaskService
+ .createExternalTaskQuery()
+ .processInstanceId(processInstance.getId())
+ .list();
+ Assertions.assertThat(externalTasks1)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks1.get(0).getWorkerId()).isNull();
// find external task and lock
final List locked = externalTaskService.fetchAndLock(1, "0815", true).topic("topic4",
5000).execute();
- assertThat(locked).isNotNull();
- assertThat(locked.size()).isEqualTo(1);
+ Assertions.assertThat(locked)
+ .isNotNull()
+ .hasSize(1);
final LockedExternalTask lockedExternalTask = locked.get(0);
// call route "direct:testRoute"
@@ -492,64 +540,77 @@ public T evaluate(Exchange exchange, Class type) {
lockedExternalTask.getId());
// ensure endpoint has been called
- assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
// assert that process in end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNotNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNotNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
// assert that the variables sent in the response-message has been set
// into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(3);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(3);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar2");
- assertThat(variablesAsMap.containsKey("var3")).isTrue();
- assertThat(variablesAsMap.get("var3")).isEqualTo("bar3");
-
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar2")
+ .containsEntry("var3", "bar3");
}
@Test
@Deployment(resources = { "process/StartExternalTask4.bpmn20.xml" })
- public void testCompleteTaskFailure() throws Exception {
-
+ public void testCompleteTaskFailure() {
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
processVariables.put("var3", "foobar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess2",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// external task is still not resolved and not locked
final List externalTasks1 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks1).isNotNull();
- assertThat(externalTasks1.size()).isEqualTo(1);
- assertThat(externalTasks1.get(0).getWorkerId()).isNull();
- assertThat(externalTasks1.get(0).getRetries()).isNull();
+ Assertions.assertThat(externalTasks1)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks1.get(0).getWorkerId()).isNull();
+ Assertions.assertThat(externalTasks1.get(0).getRetries()).isNull();
// find external task and lock
final List locked = externalTaskService.fetchAndLock(1, "0815", true).topic("topic4",
5000).execute();
- assertThat(locked).isNotNull();
- assertThat(locked.size()).isEqualTo(1);
+ Assertions.assertThat(locked)
+ .isNotNull()
+ .hasSize(1);
final LockedExternalTask lockedExternalTask = locked.get(0);
/*
@@ -576,43 +637,57 @@ public T evaluate(Exchange exchange, Class type) {
lockedExternalTask.getId());
// ensure endpoint has been called
- assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
// external task is still not resolved
final List externalTasks2 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks2).isNotNull();
- assertThat(externalTasks2.size()).isEqualTo(1);
+ Assertions.assertThat(externalTasks2)
+ .isNotNull()
+ .hasSize(1);
// Exception aborted processing so retries could not be set!
- assertThat(externalTasks2.get(0).getRetries()).isNull();
- assertThat(externalTasks2.get(0).getErrorMessage()).isNull();
+ Assertions.assertThat(externalTasks2.get(0).getRetries()).isNull();
+ Assertions.assertThat(externalTasks2.get(0).getErrorMessage()).isNull();
// assert that process not in the end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
// assert that the variables unchanged
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(3);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(3);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar");
- assertThat(variablesAsMap.containsKey("var3")).isTrue();
- assertThat(variablesAsMap.get("var3")).isEqualTo("foobar");
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar")
+ .containsEntry("var3", "foobar");
/*
* test common exception
@@ -624,11 +699,8 @@ public T evaluate(Exchange exchange, Class type) {
// variables returned but must not be set since task will not be
// completed
- mockEndpoint.whenAnyExchangeReceived(new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- throw new Exception(FAILURE);
- }
+ mockEndpoint.whenAnyExchangeReceived(exchange -> {
+ throw new Exception(FAILURE);
});
// call route "direct:testRoute"
@@ -644,43 +716,57 @@ public void process(Exchange exchange) throws Exception {
}
// ensure endpoint has been called
- assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
// external task is still not resolved
final List externalTasks4 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks4).isNotNull();
- assertThat(externalTasks4.size()).isEqualTo(1);
+ Assertions.assertThat(externalTasks4)
+ .isNotNull()
+ .hasSize(1);
// Exception aborted processing so retries could not be set!
- assertThat(externalTasks4.get(0).getRetries()).isEqualTo(2);
- assertThat(externalTasks4.get(0).getErrorMessage()).isEqualTo(FAILURE);
+ Assertions.assertThat(externalTasks4.get(0).getRetries()).isEqualTo(2);
+ Assertions.assertThat(externalTasks4.get(0).getErrorMessage()).isEqualTo(FAILURE);
// assert that process not in the end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
// assert that the variables unchanged
final List variables2 = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables2.size()).isEqualTo(3);
- final HashMap variablesAsMap2 = new HashMap();
+ Assertions.assertThat(variables2).hasSize(3);
+ final HashMap variablesAsMap2 = new HashMap<>();
for (final HistoricVariableInstance variable : variables2) {
variablesAsMap2.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap2.containsKey("var1")).isTrue();
- assertThat(variablesAsMap2.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap2.containsKey("var2")).isTrue();
- assertThat(variablesAsMap2.get("var2")).isEqualTo("bar");
- assertThat(variablesAsMap2.containsKey("var3")).isTrue();
- assertThat(variablesAsMap2.get("var3")).isEqualTo("foobar");
+ Assertions.assertThat(variablesAsMap2)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar")
+ .containsEntry("var3", "foobar");
// complete task to make test order not relevant
externalTaskService.complete(externalTasks2.get(0).getId(), "0815");
@@ -689,37 +775,38 @@ public void process(Exchange exchange) throws Exception {
@Test
@Deployment(resources = { "process/StartExternalTask4.bpmn20.xml" })
- public void testSetExternalTaskRetriesAnnotation() throws Exception {
-
+ public void testSetExternalTaskRetriesAnnotation() {
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
processVariables.put("var3", "foobar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess2",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// external task is still not resolved and not locked
final List externalTasks1 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks1).isNotNull();
- assertThat(externalTasks1.size()).isEqualTo(1);
- assertThat(externalTasks1.get(0).getWorkerId()).isNull();
- assertThat(externalTasks1.get(0).getRetries()).isNull();
+ Assertions.assertThat(externalTasks1)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks1.get(0).getWorkerId()).isNull();
+ Assertions.assertThat(externalTasks1.get(0).getRetries()).isNull();
// find external task and lock
final List locked = externalTaskService.fetchAndLock(1, "0815", true).topic("topic4",
5000).execute();
- assertThat(locked).isNotNull();
- assertThat(locked.size()).isEqualTo(1);
+ Assertions.assertThat(locked)
+ .isNotNull()
+ .hasSize(1);
final LockedExternalTask lockedExternalTask = locked.get(0);
// set retries artificially
externalTaskService.handleFailure(lockedExternalTask.getId(), "0815", "Blabal", 2, 0);
/*
- * DontChangeRetriesException
+ * DoNotChangeRetriesException
*/
mockEndpoint.reset();
@@ -728,11 +815,8 @@ public void testSetExternalTaskRetriesAnnotation() throws Exception {
// variables returned but must not be set since task will not be
// completed
- mockEndpoint.whenAnyExchangeReceived(new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- throw new DontChangeRetriesException(DONTCHANGEMSG);
- }
+ mockEndpoint.whenAnyExchangeReceived(exchange -> {
+ throw new DontChangeRetriesException(DONTCHANGEMSG);
});
// call route "direct:testRoute"
@@ -748,59 +832,67 @@ public void process(Exchange exchange) throws Exception {
}
// ensure endpoint has been called
- assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
// external task is still not resolved
final List externalTasks4 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks4).isNotNull();
- assertThat(externalTasks4.size()).isEqualTo(1);
+ Assertions.assertThat(externalTasks4)
+ .isNotNull()
+ .hasSize(1);
// Exception aborted processing so retries could not be set!
- assertThat(externalTasks4.get(0).getRetries()).isEqualTo(2);
- assertThat(externalTasks4.get(0).getErrorMessage()).isEqualTo(DONTCHANGEMSG);
+ Assertions.assertThat(externalTasks4.get(0).getRetries()).isEqualTo(2);
+ Assertions.assertThat(externalTasks4.get(0).getErrorMessage()).isEqualTo(DONTCHANGEMSG);
// assert that process not in the end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
// assert that the variables unchanged
final List variables2 = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables2.size()).isEqualTo(3);
- final HashMap variablesAsMap2 = new HashMap();
+ Assertions.assertThat(variables2).hasSize(3);
+ final HashMap variablesAsMap2 = new HashMap<>();
for (final HistoricVariableInstance variable : variables2) {
variablesAsMap2.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap2.containsKey("var1")).isTrue();
- assertThat(variablesAsMap2.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap2.containsKey("var2")).isTrue();
- assertThat(variablesAsMap2.get("var2")).isEqualTo("bar");
- assertThat(variablesAsMap2.containsKey("var3")).isTrue();
- assertThat(variablesAsMap2.get("var3")).isEqualTo("foobar");
-
+ Assertions.assertThat(variablesAsMap2)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar")
+ .containsEntry("var3", "foobar");
/*
- * DontChangeRetriesException
+ * DoNotChangeRetriesException
*/
-
mockEndpoint.reset();
-
final String CREATEINCIDENT = "Incident";
// variables returned but must not be set since task will not be
// completed
- mockEndpoint.whenAnyExchangeReceived(new Processor() {
- @Override
- public void process(Exchange exchange) throws Exception {
- throw new CreateIncidentException(CREATEINCIDENT);
- }
+ mockEndpoint.whenAnyExchangeReceived(exchange -> {
+ throw new CreateIncidentException(CREATEINCIDENT);
});
// call route "direct:testRoute"
@@ -816,60 +908,71 @@ public void process(Exchange exchange) throws Exception {
}
// ensure endpoint has been called
- assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0)).isNotNull();
// external task is still not resolved
final List externalTasks3 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks3).isNotNull();
- assertThat(externalTasks3.size()).isEqualTo(1);
+ Assertions.assertThat(externalTasks3)
+ .isNotNull()
+ .hasSize(1);
// Exception aborted processing so retries could not be set!
- assertThat(externalTasks3.get(0).getRetries()).isEqualTo(0);
- assertThat(externalTasks3.get(0).getErrorMessage()).isEqualTo(CREATEINCIDENT);
+ Assertions.assertThat(externalTasks3.get(0).getRetries()).isZero();
+ Assertions.assertThat(externalTasks3.get(0).getErrorMessage()).isEqualTo(CREATEINCIDENT);
// assert that process not in the end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
// assert that the variables unchanged
final List variables3 = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables3.size()).isEqualTo(3);
- final HashMap variablesAsMap3 = new HashMap();
+ Assertions.assertThat(variables3).hasSize(3);
+ final HashMap variablesAsMap3 = new HashMap<>();
for (final HistoricVariableInstance variable : variables3) {
variablesAsMap3.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap3.containsKey("var1")).isTrue();
- assertThat(variablesAsMap3.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap3.containsKey("var2")).isTrue();
- assertThat(variablesAsMap3.get("var2")).isEqualTo("bar");
- assertThat(variablesAsMap3.containsKey("var3")).isTrue();
- assertThat(variablesAsMap3.get("var3")).isEqualTo("foobar");
-
+ Assertions.assertThat(variablesAsMap3)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar")
+ .containsEntry("var3", "foobar");
// complete task to make test order not relevant
externalTaskService.complete(externalTasks1.get(0).getId(), "0815");
-
}
- @SuppressWarnings("unchecked")
@Test
@Deployment(resources = { "process/StartExternalTask2.bpmn20.xml" })
+ @SuppressWarnings("unchecked")
public void testAsyncIsTrueAndLockDuration() throws Exception {
-
// variables returned but must not be set since task will not be
// completed
mockEndpoint.returnReplyBody(new Expression() {
@Override
public T evaluate(Exchange exchange, Class type) {
- final HashMap result = new HashMap();
+ final HashMap result = new HashMap<>();
result.put("var2", "bar2");
result.put("var3", "bar3");
return (T) result;
@@ -877,13 +980,13 @@ public T evaluate(Exchange exchange, Class type) {
});
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
processVariables.put("var3", "foobar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess2",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// wait for the external task to be completed
Thread.sleep(1000);
@@ -891,58 +994,77 @@ public T evaluate(Exchange exchange, Class type) {
// external task is still not resolved and locked
final List externalTasks1 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks1).isNotNull();
- assertThat(externalTasks1.size()).isEqualTo(1);
- assertThat(externalTasks1.get(0).getWorkerId()).isEqualTo("0815");
- assertThat(externalTasks1.get(0).getLockExpirationTime()).isAfter(new Date());
+ Assertions.assertThat(externalTasks1)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks1.get(0).getWorkerId()).isEqualTo("0815");
+ Assertions.assertThat(externalTasks1.get(0).getLockExpirationTime()).isAfter(new Date());
- // wait for the task to unlock and refetch by Camel
+ // wait for the task to unlock and re-fetch by Camel
Thread.sleep(2000);
// assert that the camunda BPM process instance ID has been added as a
// property to the message for both exchanges received
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(
- processInstance.getId());
- assertThat(mockEndpoint.assertExchangeReceived(1).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(
- processInstance.getId());
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(1)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
// only two process instance variables are loaded according configured
// value of "variablesToFetch" parameter
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody()).isNotNull();
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody()).isInstanceOf(Map.class);
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class).size()).isEqualTo(2);
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class)).containsKey("var2");
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class)).containsKey("var3");
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class)).containsValue("bar");
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class)).containsValue("foobar");
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody()).isNotNull();
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody()).isInstanceOf(Map.class);
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class)).hasSize(2);
+ Assertions.assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class))
+ .containsEntry("var2", "bar")
+ .containsEntry("var3", "foobar");
// assert that the variables sent in the response-message has NOT been
// set into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(3);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(3);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar");
- assertThat(variablesAsMap.containsKey("var3")).isTrue();
- assertThat(variablesAsMap.get("var3")).isEqualTo("foobar");
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar")
+ .containsEntry("var3", "foobar");
// assert that process NOT in end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
}
@@ -950,7 +1072,6 @@ public T evaluate(Exchange exchange, Class type) {
@Test
@Deployment(resources = { "process/StartExternalTask.bpmn20.xml" })
public void testBpmnError() throws Exception {
-
// variables to be set by the Camel-endpoint processing the external
// task
mockEndpoint.returnReplyBody(new Expression() {
@@ -961,12 +1082,12 @@ public T evaluate(Exchange exchange, Class type) {
});
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// wait for the external task to be completed
Thread.sleep(1000);
@@ -974,69 +1095,81 @@ public T evaluate(Exchange exchange, Class type) {
// external task is still not resolved
final long externalTasksCount = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).active().count();
- assertThat(externalTasksCount).isEqualTo(0);
+ Assertions.assertThat(externalTasksCount).isZero();
// assert that the camunda BPM process instance ID has been added as a
// property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(
- processInstance.getId());
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
// assert that the variables sent in the response-message has been set
// into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(2);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(2);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar");
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar");
// assert that process ended
final HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(
processInstance.getId()).singleResult();
- assertThat(historicProcessInstance.getEndTime()).isNotNull();
+ Assertions.assertThat(historicProcessInstance.getEndTime()).isNotNull();
// assert that process ended due to error boundary event 4711
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End4711").singleResult()).isNotNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End4711")
+ .singleResult())
+ .isNotNull();
// assert that process not in end event "HappyEnd"
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("HappyEnd").singleResult()).isNull();
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("HappyEnd")
+ .singleResult())
+ .isNull();
// assert that process ended not due to error boundary event 0815
- assertThat(historyService.createHistoricActivityInstanceQuery().processInstanceId(
- processInstance.getId()).activityId("End0815").singleResult()).isNull();
-
+ Assertions
+ .assertThat(historyService
+ .createHistoricActivityInstanceQuery()
+ .processInstanceId(processInstance.getId())
+ .activityId("End0815")
+ .singleResult())
+ .isNull();
}
@Test
@Deployment(resources = { "process/StartExternalTask.bpmn20.xml" })
public void testIncidentAndRetryTimeouts() throws Exception {
-
// variables to be set by the Camel-endpoint processing the external
// task
- mockEndpoint.whenAnyExchangeReceived(new Processor() {
- @Override
- public void process(final Exchange exchange) throws Exception {
- throw new RuntimeException("fail!");
- }
+ mockEndpoint.whenAnyExchangeReceived(exchange -> {
+ throw new RuntimeException("fail!");
});
// count incidents for later comparison
final long incidentCount = runtimeService.createIncidentQuery().count();
// start process
- final Map processVariables = new HashMap();
+ final Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
final ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("startExternalTaskProcess",
processVariables);
- assertThat(processInstance).isNotNull();
+ Assertions.assertThat(processInstance).isNotNull();
// wait for the external task to be completed
Thread.sleep(1000);
@@ -1044,9 +1177,10 @@ public void process(final Exchange exchange) throws Exception {
// external task is still not resolved
final List externalTasks1 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks1).isNotNull();
- assertThat(externalTasks1.size()).isEqualTo(1);
- assertThat(externalTasks1.get(0).getRetries()).isEqualTo(2);
+ Assertions.assertThat(externalTasks1)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks1.get(0).getRetries()).isEqualTo(2);
// wait for the next try
Thread.sleep(1000);
@@ -1054,9 +1188,10 @@ public void process(final Exchange exchange) throws Exception {
// external task is still not resolved
final List externalTasks2 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks2).isNotNull();
- assertThat(externalTasks2.size()).isEqualTo(1);
- assertThat(externalTasks2.get(0).getRetries()).isEqualTo(1);
+ Assertions.assertThat(externalTasks2)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks2.get(0).getRetries()).isEqualTo(1);
// next try is 2 seconds so after 1 second nothing changes
Thread.sleep(1000);
@@ -1064,9 +1199,10 @@ public void process(final Exchange exchange) throws Exception {
// external task is still not resolved
final List externalTasks3 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks3).isNotNull();
- assertThat(externalTasks3.size()).isEqualTo(1);
- assertThat(externalTasks3.get(0).getRetries()).isEqualTo(1);
+ Assertions.assertThat(externalTasks3)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks3.get(0).getRetries()).isEqualTo(1);
// wait for the next try
Thread.sleep(1000);
@@ -1074,44 +1210,63 @@ public void process(final Exchange exchange) throws Exception {
// external task is still not resolved
final List externalTasks4 = externalTaskService.createExternalTaskQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(externalTasks4).isNotNull();
- assertThat(externalTasks4.size()).isEqualTo(1);
- assertThat(externalTasks4.get(0).getRetries()).isEqualTo(0);
+ Assertions.assertThat(externalTasks4)
+ .isNotNull()
+ .hasSize(1);
+ Assertions.assertThat(externalTasks4.get(0).getRetries()).isZero();
// assert that the camunda BPM process instance ID has been added as a
// property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(
- processInstance.getId());
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
// assert that in-headers are set properly
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getHeader(EXCHANGE_HEADER_ATTEMPTSSTARTED)).isEqualTo(
- 0);
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getHeader(EXCHANGE_HEADER_RETRIESLEFT)).isEqualTo(2);
- assertThat(mockEndpoint.assertExchangeReceived(1).getIn().getHeader(EXCHANGE_HEADER_ATTEMPTSSTARTED)).isEqualTo(
- 1);
- assertThat(mockEndpoint.assertExchangeReceived(1).getIn().getHeader(EXCHANGE_HEADER_RETRIESLEFT)).isEqualTo(1);
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getHeader(CamundaBpmConstants.EXCHANGE_HEADER_ATTEMPTSSTARTED))
+ .isEqualTo(0);
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getHeader(CamundaBpmConstants.EXCHANGE_HEADER_RETRIESLEFT))
+ .isEqualTo(2);
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(1)
+ .getIn()
+ .getHeader(CamundaBpmConstants.EXCHANGE_HEADER_ATTEMPTSSTARTED))
+ .isEqualTo(1);
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(1)
+ .getIn()
+ .getHeader(CamundaBpmConstants.EXCHANGE_HEADER_RETRIESLEFT))
+ .isEqualTo(1);
// assert that the variables sent in the response-message has been set
// into the process
final List variables = historyService.createHistoricVariableInstanceQuery().processInstanceId(
processInstance.getId()).list();
- assertThat(variables.size()).isEqualTo(2);
- final HashMap variablesAsMap = new HashMap();
+ Assertions.assertThat(variables).hasSize(2);
+ final HashMap variablesAsMap = new HashMap<>();
for (final HistoricVariableInstance variable : variables) {
variablesAsMap.put(variable.getName(), variable.getValue());
}
- assertThat(variablesAsMap.containsKey("var1")).isTrue();
- assertThat(variablesAsMap.get("var1")).isEqualTo("foo");
- assertThat(variablesAsMap.containsKey("var2")).isTrue();
- assertThat(variablesAsMap.get("var2")).isEqualTo("bar");
+ Assertions.assertThat(variablesAsMap)
+ .containsEntry("var1", "foo")
+ .containsEntry("var2", "bar");
// assert that process not ended
final HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(
processInstance.getId()).singleResult();
- assertThat(historicProcessInstance.getEndTime()).isNull();
+ Assertions.assertThat(historicProcessInstance.getEndTime()).isNull();
// assert that incident raised
- assertThat(runtimeService.createIncidentQuery().count()).isEqualTo(incidentCount + 1);
-
+ Assertions.assertThat(runtimeService.createIncidentQuery().count()).isEqualTo(incidentCount + 1);
}
-
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ReceiveFromCamelTest.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ReceiveFromCamelTest.java
index 40cd161..9e9bf6c 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ReceiveFromCamelTest.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/ReceiveFromCamelTest.java
@@ -15,6 +15,7 @@
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
import org.assertj.core.api.Assertions;
+import org.camunda.bpm.camel.component.CamundaBpmConstants;
import org.camunda.bpm.engine.HistoryService;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.ProcessInstance;
@@ -32,28 +33,24 @@
import java.util.HashMap;
import java.util.Map;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.*;
-
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:receive-from-camel-config.xml")
public class ReceiveFromCamelTest {
-
MockEndpoint mockEndpoint;
- @Autowired(required = true)
+ @Autowired
ApplicationContext applicationContext;
- @Autowired(required = true)
+ @Autowired
CamelContext camelContext;
- @Autowired(required = true)
+ @Autowired
RuntimeService runtimeService;
- @Autowired(required = true)
+ @Autowired
HistoryService historyService;
- @Autowired(required = true)
+ @Autowired
@Rule
public ProcessEngineRule processEngineRule;
@@ -65,15 +62,25 @@ public void setUp() {
@Test
@Deployment(resources = {"process/ReceiveFromCamel.bpmn20.xml"})
- public void doTest() throws Exception {
- Map processVariables = new HashMap();
+ public void doTest() {
+ Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("receiveFromCamelProcess", processVariables);
// Verify that a process instance has executed and there is one instance executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("receiveFromCamelProcess").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("receiveFromCamelProcess").count()).isEqualTo(1);
+ Assertions
+ .assertThat(historyService
+ .createHistoricProcessInstanceQuery()
+ .processDefinitionKey("receiveFromCamelProcess")
+ .count())
+ .isEqualTo(1);
+ Assertions
+ .assertThat(runtimeService
+ .createProcessInstanceQuery()
+ .processDefinitionKey("receiveFromCamelProcess")
+ .count())
+ .isEqualTo(1);
/*
* We need the process instance ID to be able to send the message to it
@@ -82,12 +89,25 @@ public void doTest() throws Exception {
* http://camundabpm.blogspot.de/2013/06/introducing-activity-instance-model-to.html
*/
ProducerTemplate tpl = camelContext.createProducerTemplate();
- tpl.sendBodyAndProperty("direct:sendToCamundaBpm", null, EXCHANGE_HEADER_PROCESS_INSTANCE_ID, processInstance.getId());
+ tpl.sendBodyAndProperty(
+ "direct:sendToCamundaBpm",
+ null,
+ CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID,
+ processInstance.getId());
// Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(processInstance.getId());
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
// Assert that the process instance is finished
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("receiveFromCamelProcess").count()).isEqualTo(0);
+ Assertions
+ .assertThat(runtimeService
+ .createProcessInstanceQuery()
+ .processDefinitionKey("receiveFromCamelProcess")
+ .count())
+ .isZero();
}
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SendToCamelTest.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SendToCamelTest.java
index bdd2899..24b8d68 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SendToCamelTest.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SendToCamelTest.java
@@ -14,6 +14,7 @@
import org.apache.camel.CamelContext;
import org.apache.camel.component.mock.MockEndpoint;
import org.assertj.core.api.Assertions;
+import org.camunda.bpm.camel.component.CamundaBpmConstants;
import org.camunda.bpm.engine.HistoryService;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.runtime.ProcessInstance;
@@ -31,28 +32,25 @@
import java.util.HashMap;
import java.util.Map;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.*;
-
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:send-to-camel-config.xml")
public class SendToCamelTest {
MockEndpoint mockEndpoint;
- @Autowired(required = true)
+ @Autowired
ApplicationContext applicationContext;
- @Autowired(required = true)
+ @Autowired
CamelContext camelContext;
- @Autowired(required = true)
+ @Autowired
RuntimeService runtimeService;
- @Autowired(required = true)
+ @Autowired
HistoryService historyService;
- @Autowired(required = true)
+ @Autowired
@Rule
public ProcessEngineRule processEngineRule;
@@ -64,21 +62,39 @@ public void setUp() {
@Test
@Deployment(resources = {"process/SendToCamel.bpmn20.xml"})
- public void doTest() throws Exception {
- Map processVariables = new HashMap();
+ public void doTest() {
+ Map processVariables = new HashMap<>();
processVariables.put("var1", "foo");
processVariables.put("var2", "bar");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("sendToCamelProcess", processVariables);
// Verify that a process instance was executed and there are no instances executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("sendToCamelProcess").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("sendToCamelProcess").count()).isEqualTo(0);
+ Assertions
+ .assertThat(historyService
+ .createHistoricProcessInstanceQuery()
+ .processDefinitionKey("sendToCamelProcess")
+ .count())
+ .isEqualTo(1);
+ Assertions
+ .assertThat(runtimeService
+ .createProcessInstanceQuery()
+ .processDefinitionKey("sendToCamelProcess")
+ .count())
+ .isZero();
// Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(processInstance.getId());
+ Assertions.assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstance.getId());
// Assert that the body of the message received by the endpoint contains a hash map with the value of the process variable 'var1' sent from camunda BPM
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo("{var1=foo}");
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(String.class))
+ .isEqualTo("{var1=foo}");
// FIXME: check that var2 is also present as a property!
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SmokeTest.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SmokeTest.java
index 3760551..10ffa03 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SmokeTest.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/SmokeTest.java
@@ -2,7 +2,6 @@
import static org.assertj.core.api.Assertions.assertThat;
-import org.assertj.core.api.Assertions;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.TaskService;
import org.camunda.bpm.engine.task.Task;
@@ -15,15 +14,14 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:smoke-test-config.xml")
public class SmokeTest {
- @Autowired(required = true)
+ @Autowired
RuntimeService runtimeService;
- @Autowired(required = true)
+ @Autowired
TaskService taskService;
@Autowired
@@ -32,12 +30,12 @@ public class SmokeTest {
@Test
@Deployment(resources = {"process/SmokeTest.bpmn20.xml"} )
- public void smokeTest() throws Exception {
+ public void smokeTest() {
runtimeService.startProcessInstanceByKey("smokeTestProcess");
Task task = taskService.createTaskQuery().singleResult();
- assertThat("My Task").isEqualTo(task.getName());
+ assertThat(task.getName()).isEqualTo("My Task");
taskService.complete(task.getId());
- assertThat(runtimeService.createProcessInstanceQuery().count()).isEqualTo(0);
+ assertThat(runtimeService.createProcessInstanceQuery().count()).isZero();
}
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/StartProcessFromRouteTest.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/StartProcessFromRouteTest.java
index 205079f..512d0c3 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/StartProcessFromRouteTest.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/StartProcessFromRouteTest.java
@@ -17,6 +17,7 @@
import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.mock.MockEndpoint;
import org.assertj.core.api.Assertions;
+import org.camunda.bpm.camel.component.CamundaBpmConstants;
import org.camunda.bpm.engine.HistoryService;
import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.test.Deployment;
@@ -32,9 +33,6 @@
import java.util.Collections;
import java.util.Map;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.camunda.bpm.camel.component.CamundaBpmConstants.*;
-
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:start-process-from-route-config.xml")
public class StartProcessFromRouteTest {
@@ -42,16 +40,16 @@ public class StartProcessFromRouteTest {
MockEndpoint mockEndpoint;
MockEndpoint processVariableEndpoint;
- @Autowired(required = true)
+ @Autowired
CamelContext camelContext;
- @Autowired(required = true)
+ @Autowired
RuntimeService runtimeService;
- @Autowired(required = true)
+ @Autowired
HistoryService historyService;
- @Autowired(required = true)
+ @Autowired
@Rule
public ProcessEngineRule processEngineRule;
@@ -65,97 +63,197 @@ public void setUp() {
@Test
@Deployment(resources = {"process/StartProcessFromRoute.bpmn20.xml"})
- public void doTest() throws Exception {
+ public void doTest() {
ProducerTemplate tpl = camelContext.createProducerTemplate();
String processInstanceId = (String) tpl.requestBody("direct:start", Collections.singletonMap("var1", "valueOfVar1"));
- assertThat(processInstanceId).isNotNull();
+ Assertions.assertThat(processInstanceId).isNotNull();
System.out.println("Process instance ID: " + processInstanceId);
// Verify that a process instance was executed and there are no instances executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(0);
+ Assertions
+ .assertThat(historyService
+ .createHistoricProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute")
+ .count())
+ .isEqualTo(1);
+ Assertions
+ .assertThat(runtimeService
+ .createProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute")
+ .count())
+ .isZero();
// Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isEqualTo(processInstanceId);
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isEqualTo(processInstanceId);
- // The body of the message comming out from the camunda-bpm: endpoint is the process instance
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo(processInstanceId);
+ // The body of the message coming out from the camunda-bpm: endpoint is the process instance
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(String.class))
+ .isEqualTo(processInstanceId);
// We should receive a hash map as the body of the message with a 'var1' key
- assertThat(processVariableEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo("{var1=valueOfVar1}");
+ Assertions
+ .assertThat(processVariableEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(String.class))
+ .isEqualTo("{var1=valueOfVar1}");
}
@Test
@Deployment(resources = {"process/StartProcessFromRoute.bpmn20.xml"})
- public void doTestReturnVariable() throws Exception {
+ public void doTestReturnVariable() {
ProducerTemplate tpl = camelContext.createProducerTemplate();
String var1 = (String) tpl.requestBody("direct:startReturnVariable", Collections.singletonMap("var1", "valueOfVar1"));
- assertThat(var1).isNotNull();
+ Assertions.assertThat(var1).isNotNull();
// Verify that a process instance was executed and there are no instances executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(0);
+ Assertions
+ .assertThat(historyService
+ .createHistoricProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute")
+ .count())
+ .isEqualTo(1);
+ Assertions
+ .assertThat(runtimeService
+ .createProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute")
+ .count())
+ .isZero();
// Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isNotNull();
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isNotNull();
- // The body of the message comming out from the camunda-bpm: endpoint is the process instance
- assertThat(var1).isEqualTo("valueOfVar1");
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo(var1);
+ // The body of the message coming out from the camunda-bpm: endpoint is the process instance
+ Assertions.assertThat(var1).isEqualTo("valueOfVar1");
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(String.class))
+ .isEqualTo(var1);
// We should receive a hash map as the body of the message with a 'var1' key
- assertThat(processVariableEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo("{var1=valueOfVar1}");
+ Assertions
+ .assertThat(processVariableEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(String.class))
+ .isEqualTo("{var1=valueOfVar1}");
}
@Test
@Deployment(resources = {"process/StartProcessFromRoute.bpmn20.xml"})
- public void doTestReturnVariables() throws Exception {
+ @SuppressWarnings("unchecked")
+ public void doTestReturnVariables() {
ProducerTemplate tpl = camelContext.createProducerTemplate();
Map vars = (Map) tpl.requestBody("direct:startReturnVariables", Collections.singletonMap("var1", "valueOfVar1"));
- assertThat(vars).isNotNull();
+ Assertions.assertThat(vars).isNotNull();
// Verify that a process instance was executed and there are no instances executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(0);
+ Assertions
+ .assertThat(historyService
+ .createHistoricProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute"
+ ).count())
+ .isEqualTo(1);
+ Assertions
+ .assertThat(runtimeService
+ .createProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute")
+ .count())
+ .isZero();
// Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isNotNull();
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isNotNull();
- // The body of the message comming out from the camunda-bpm: endpoint is the process instance
- assertThat(vars).isNotNull();
- assertThat(vars.size()).isEqualTo(1);
- assertThat(vars.get("var1")).isEqualTo("valueOfVar1");
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class)).isEqualTo(vars);
+ // The body of the message coming out from the camunda-bpm: endpoint is the process instance
+ Assertions.assertThat(vars)
+ .isNotNull()
+ .hasSize(1)
+ .containsEntry("var1", "valueOfVar1");
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(Map.class))
+ .isEqualTo(vars);
// We should receive a hash map as the body of the message with a 'var1' key
- assertThat(processVariableEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo("{var1=valueOfVar1}");
+ Assertions
+ .assertThat(processVariableEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(String.class))
+ .isEqualTo("{var1=valueOfVar1}");
}
@Test
@Deployment(resources = {"process/StartProcessFromRoute.bpmn20.xml"})
- public void doTestReturnAllVariables() throws Exception {
+ @SuppressWarnings("unchecked")
+ public void doTestReturnAllVariables() {
ProducerTemplate tpl = camelContext.createProducerTemplate();
Map vars = (Map) tpl.requestBody("direct:startReturnAllVariables", Collections.singletonMap("var1", "valueOfVar1"));
- assertThat(vars).isNotNull();
+ Assertions.assertThat(vars).isNotNull();
// Verify that a process instance was executed and there are no instances executing now
- assertThat(historyService.createHistoricProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(1);
- assertThat(runtimeService.createProcessInstanceQuery().processDefinitionKey("startProcessFromRoute").count()).isEqualTo(0);
+ Assertions
+ .assertThat(historyService
+ .createHistoricProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute")
+ .count())
+ .isEqualTo(1);
+ Assertions
+ .assertThat(runtimeService
+ .createProcessInstanceQuery()
+ .processDefinitionKey("startProcessFromRoute")
+ .count())
+ .isZero();
// Assert that the camunda BPM process instance ID has been added as a property to the message
- assertThat(mockEndpoint.assertExchangeReceived(0).getProperty(EXCHANGE_HEADER_PROCESS_INSTANCE_ID)).isNotNull();
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getProperty(CamundaBpmConstants.EXCHANGE_HEADER_PROCESS_INSTANCE_ID))
+ .isNotNull();
- // The body of the message comming out from the camunda-bpm: endpoint is the process instance
- assertThat(vars).isNotNull();
- assertThat(vars.size()).isEqualTo(1);
- assertThat(vars.get("var1")).isEqualTo("valueOfVar1");
- assertThat(mockEndpoint.assertExchangeReceived(0).getIn().getBody(Map.class)).isEqualTo(vars);
+ // The body of the message coming out from the camunda-bpm: endpoint is the process instance
+ Assertions.assertThat(vars)
+ .isNotNull()
+ .hasSize(1)
+ .containsEntry("var1", "valueOfVar1");
+ Assertions
+ .assertThat(mockEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(Map.class))
+ .isEqualTo(vars);
// We should receive a hash map as the body of the message with a 'var1' key
- assertThat(processVariableEndpoint.assertExchangeReceived(0).getIn().getBody(String.class)).isEqualTo("{var1=valueOfVar1}");
+ Assertions
+ .assertThat(processVariableEndpoint
+ .assertExchangeReceived(0)
+ .getIn()
+ .getBody(String.class))
+ .isEqualTo("{var1=valueOfVar1}");
}
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenService.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenService.java
index dff79bb..6e42508 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenService.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenService.java
@@ -22,7 +22,6 @@
*
*/
public class BrokenService {
-
private static final Logger LOG = LoggerFactory.getLogger(BrokenService.class);
/**
@@ -35,5 +34,4 @@ public void alwaysFails() throws BrokenServiceException {
LOG.info("{} called", this.getClass().getSimpleName());
throw new BrokenServiceException("Provoked failure");
}
-
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenServiceException.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenServiceException.java
index 1969a58..c2fff46 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenServiceException.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/BrokenServiceException.java
@@ -18,11 +18,9 @@
*
*/
public class BrokenServiceException extends Exception {
-
private static final long serialVersionUID = 1L;
public BrokenServiceException(String message) {
super(message);
}
-
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyExecutionListener.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyExecutionListener.java
index c4ceb9a..b278186 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyExecutionListener.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyExecutionListener.java
@@ -5,14 +5,12 @@
/**
* Attach to the ReceiveTask (end event).
- *
- * @author stefan.schulze@accelsis.biz
*
+ * @author stefan.schulze@accelsis.biz
*/
public class DummyExecutionListener implements ExecutionListener {
-
- @Override
- public void notify(DelegateExecution execution) throws Exception {
- // dummy
- }
+ @Override
+ public void notify(DelegateExecution execution) {
+ // dummy
+ }
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyJavaDelegate.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyJavaDelegate.java
index 8e380b1..b504b1f 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyJavaDelegate.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/DummyJavaDelegate.java
@@ -10,10 +10,8 @@
*
*/
public class DummyJavaDelegate implements JavaDelegate {
-
@Override
- public void execute(DelegateExecution execution) throws Exception {
+ public void execute(DelegateExecution execution) {
// dummy
}
-
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/InitDelegate.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/InitDelegate.java
index fbb09e0..1e6110c 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/InitDelegate.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/InitDelegate.java
@@ -5,10 +5,8 @@
import static org.camunda.bpm.camel.component.CamundaBpmConstants.*;
public class InitDelegate implements JavaDelegate {
-
@Override
public void execute(DelegateExecution execution) throws Exception {
execution.setVariable(EXCHANGE_HEADER_PROCESS_INSTANCE_ID, execution.getProcessInstanceId());
}
-
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/Routing.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/Routing.java
index b61d380..897481c 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/Routing.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/Routing.java
@@ -7,12 +7,11 @@
*
*/
public enum Routing {
-
/**
* Process should terminate normally.
*/
DEFAULT,
-
+
/**
* Camel route should throw an exception and propagate it back to the caller.
*/
@@ -22,5 +21,4 @@ public enum Routing {
* Camel route should throw an exception and handle it.
*/
HANDLE_ERROR;
-
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/SleepBean.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/SleepBean.java
index a92d8b9..b4ce98e 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/SleepBean.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/SleepBean.java
@@ -3,7 +3,6 @@
import org.apache.camel.Exchange;
public class SleepBean {
-
public void sleep(String body, Exchange exchange) throws Exception {
Thread.sleep(1500);
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TestJoinDelegate.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TestJoinDelegate.java
index 9dc20e4..96f6474 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TestJoinDelegate.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TestJoinDelegate.java
@@ -4,10 +4,8 @@
import org.camunda.bpm.engine.delegate.JavaDelegate;
public class TestJoinDelegate implements JavaDelegate {
-
@Override
public void execute(DelegateExecution execution) throws Exception {
// dummy task
}
-
}
diff --git a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TimeConsumingService.java b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TimeConsumingService.java
index 7e6be78..a08cfe8 100644
--- a/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TimeConsumingService.java
+++ b/camunda-bpm-camel-spring/src/test/java/org/camunda/bpm/camel/spring/util/TimeConsumingService.java
@@ -7,7 +7,6 @@
*
*/
public class TimeConsumingService {
-
/**
* Spend some time.
*
@@ -16,5 +15,4 @@ public class TimeConsumingService {
public void doWork() throws InterruptedException {
Thread.sleep(100);
}
-
}
diff --git a/pom.xml b/pom.xml
index d8ca3e7..e4091ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -16,29 +16,31 @@
pom
- 11
+ 17
${java.version}
${java.version}
- 7.16.0
- 3.16.0
- 5.3.19
- 1.7.36
+ 7.21.0-alpha4
+ 4.4.0
+ 6.1.3
+ 2.0.12
- 4.13.2
- 3.23.1
- 2.28.2
- 2.0.9
+ 5.10.2
+ 3.25.3
+ 5.11.0
+
+
1.4.197
-
- 3.3.2
+
+ 3.6.3
camunda-bpm-camel-common
camunda-bpm-camel-common-tests
camunda-bpm-camel-spring
+ camunda-bpm-camel-quarkus-cdi
@@ -75,6 +77,13 @@
camunda-bpm-camel-spring
${project.version}
+
+ org.junit
+ junit-bom
+ ${junit.version}
+ pom
+ import
+
@@ -145,7 +154,7 @@
false
- camunda-bpm-camel-cdi
+ camunda-bpm-camel-quarkus-cdi