Skip to content

Commit

Permalink
Closes Taskana#612: add missing jaxrs and camunda properties
Browse files Browse the repository at this point in the history
* added simple Integration Tests for
  * `camunda-outbox-example-boot`
  * `taskana-adapter-camunda-spring-boot-example`

 * added missing properties
   * `camunda.bpm.generic-properties.properties.historyTimeToLive`
   * `resteasy.jaxrs.app.registration`
   * `resteasy.jaxrs.app.classes`
  • Loading branch information
arolfes committed Nov 22, 2023
1 parent 36e65d3 commit cdbb573
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 11 deletions.
11 changes: 6 additions & 5 deletions camunda-outbox-example-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
<version>${version.camunda}</version>
<exclusions>
<exclusion>
<groupId>org.skyscreamer</groupId>
Expand All @@ -47,18 +46,14 @@
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
<version>${version.camunda}</version>
</dependency>
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-plugin-spin</artifactId>
<version>${version.camunda}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.camunda.spin</groupId>
<artifactId>camunda-spin-dataformat-json-jackson</artifactId>
<version>${version.camunda.spin}</version>
</dependency>

<!-- outbox-rest-spring-boot-starter-->
Expand All @@ -72,6 +67,12 @@
<artifactId>resteasy-servlet-spring-boot-starter</artifactId>
<version>${version.resteasy.spring.boot}</version>
</dependency>
<!-- testing dependencies -->
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ camunda.bpm.admin-user.last-name=demo

camunda.bpm.database.type=h2

# new mandatory field starting from camunda version 7.20
# see https://forum.camunda.io/t/camunda-7-20-history-time-to-live-cannot-be-null-cannot-deploy-wf-created-in-7-18/48159
camunda.bpm.generic-properties.properties.historyTimeToLive: P180D

# properties for resteasy-servlet-spring-boot-starter
# without these 2 propertiers the camunda-context is registered twice
resteasy.jaxrs.app.registration=property
resteasy.jaxrs.app.classes=pro.taskana.adapter.camunda.outbox.rest.config.OutboxRestServiceConfig

#spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
#spring.datasource.driver-class-name = org.postgresql.Driver
#spring.datasource.username = postgres
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package pro.taskana.camunda.spring.boot;

import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = CamundaSpringBootExample.class, webEnvironment = RANDOM_PORT)
class CamundaSpringBootExampleIntegrationTest {

@Test
void module_context_can_be_started() {
// there is no test code here,
// because creating the configuration to run this method is the actual test
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<logger name="pro.taskana.adapter" level="info"/>
</configuration>
10 changes: 5 additions & 5 deletions taskana-adapter-camunda-spring-boot-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>pro.taskana</groupId>
<artifactId>taskana-adapter</artifactId>
Expand Down Expand Up @@ -57,6 +52,11 @@
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ taskana-system-connector-camundaSystemURLs=http://localhost:8081/example-context
####################################################################################
#
# Configure the datasource for Taskana DB (used by taskana-connector)
taskana.datasource.jdbcUrl = jdbc:h2:tcp://localhost:9095/mem:taskana;NON_KEYWORDS=KEY,VALUE;IGNORECASE=TRUE;LOCK_MODE=0;
#taskana.datasource.jdbcUrl = jdbc:h2:tcp://localhost:9095/mem:taskana;NON_KEYWORDS=KEY,VALUE;IGNORECASE=TRUE;LOCK_MODE=0;
taskana.datasource.jdbcUrl=jdbc:h2:mem:taskana;NON_KEYWORDS=KEY,VALUE;IGNORECASE=TRUE;LOCK_MODE=0;DB_CLOSE_ON_EXIT=FALSE
taskana.datasource.driverClassName = org.h2.Driver
taskana.datasource.username = sa
taskana.datasource.password = sa
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package pro.taskana.adapter;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = TaskanaAdapterApplication.class)
class TaskanaAdapterApplicationTest {

@Test
void module_context_can_be_started_and_outbox_rest_events_are_fetched() {
// there is no test code here,
// because creating the configuration to run this method is the actual test
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<logger name="pro.taskana.adapter" level="debug"/>
</configuration>

0 comments on commit cdbb573

Please sign in to comment.