Skip to content

Commit

Permalink
Merge pull request #306 from camunda/287_jdk8_modules
Browse files Browse the repository at this point in the history
Run tests using jdk8
  • Loading branch information
remcowesterhoud authored Apr 12, 2022
2 parents 6ded9a3 + 9ab17f9 commit 7fd4330
Show file tree
Hide file tree
Showing 51 changed files with 391 additions and 221 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Check license
run: mvn license:check

build-and-test:
build-and-test-embedded:
name: Run tests on ${{ matrix.os }}
timeout-minutes: 15
needs: code-formatting
Expand All @@ -49,7 +49,7 @@ jobs:

- name: Build
id: build
run: mvn -B -U -P embedded "-Dsurefire.rerunFailingTestsCount=5" clean install
run: mvn -B -U -pl "-:zeebe-process-test-qa-testcontainers" "-Dsurefire.rerunFailingTestsCount=5" clean install

- name: Archive Test Results
uses: actions/upload-artifact@v3
Expand All @@ -75,7 +75,7 @@ jobs:
uses: actions/setup-java@v3.1.0
with:
distribution: temurin
java-version: 17 # Change to java 8 when tests are properly separated (https://github.com/camunda/zeebe-process-test/issues/195)
java-version: 17
cache: maven

- name: Package
Expand All @@ -96,9 +96,19 @@ jobs:
IMAGE_NAME_KEY: container.image.name
IMAGE_TAG_KEY: container.image.tag

- name: Downgrade Java environment
uses: actions/setup-java@v3.0.0
with:
distribution: temurin
java-version: 8
cache: maven

# Deleting .mvn/jvm.config is a workaround for JDK8, which does not support the --add-exports options
- name: Build
id: build
run: mvn -B -U -P testcontainer "-Dsurefire.rerunFailingTestsCount=5" install
run: |
rm .mvn/jvm.config
mvn -B -U -pl ":zeebe-process-test-qa-testcontainers" -am "-Dsurefire.rerunFailingTestsCount=5" install -DskipChecks
- name: Archive Test Results
uses: actions/upload-artifact@v3
Expand Down
11 changes: 7 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
<plugin.version.spotless>2.22.1</plugin.version.spotless>
<plugin.version.surefire>3.0.0-M6</plugin.version.surefire>

<skipChecks>false</skipChecks>

<version.grpc>1.45.1</version.grpc>
<version.java>17</version.java>
<version.protobuf>3.19.4</version.protobuf>
Expand Down Expand Up @@ -380,24 +382,22 @@
<version>${dependency.agrona.version}</version>
</dependency>

<!-- Test scope-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${dependency.mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${dependency.awaitility.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${dependency.commons.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -425,6 +425,8 @@
<sortProperties>true</sortProperties>
</sortPom>
</pom>
<applySkip>${skipChecks}</applySkip>
<checkSkip>${skipChecks}</checkSkip>
</configuration>
<dependencies>
<dependency>
Expand Down Expand Up @@ -516,6 +518,7 @@
</goals>
<configuration>
<failOnWarning>true</failOnWarning>
<skip>${skipChecks}</skip>
</configuration>
</execution>
</executions>
Expand Down
73 changes: 73 additions & 0 deletions qa/abstracts/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.camunda</groupId>
<artifactId>zeebe-process-test-qa</artifactId>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>zeebe-process-test-qa-abstracts</artifactId>
<packaging>jar</packaging>

<name>Zeebe Process Test QA Abstracts</name>

<properties>
<version.java>8</version.java>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-process-test-filters</artifactId>
</dependency>

<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-process-test-assertions</artifactId>
</dependency>

<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-protocol</artifactId>
</dependency>

<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-client-java</artifactId>
</dependency>

<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-process-test-api</artifactId>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import io.camunda.zeebe.client.api.response.DeploymentEvent;
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.assertions.ProcessAssert;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackMultipleTasks;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackMultipleTasks;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.assertions.IncidentAssert;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.protocol.record.value.ErrorType;
import java.time.Duration;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.assertions.IncidentAssert;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.protocol.record.value.ErrorType;
import java.time.Duration;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import io.camunda.zeebe.client.api.response.PublishMessageResponse;
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackMessageEvent;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackMessageStartEvent;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackMessageEvent;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackMessageStartEvent;
import java.time.Duration;
import java.util.Collections;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.assertions.ProcessAssert;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackLoopingServiceTask;
import java.util.concurrent.TimeoutException;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.assertions.IncidentAssert;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackMessageEvent;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackMultipleTasks;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackLoopingServiceTask;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackMessageEvent;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackMultipleTasks;
import io.camunda.zeebe.protocol.record.value.ErrorType;
import java.time.Duration;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@
package io.camunda.zeebe.process.test.qa.abstracts.examples;

import static io.camunda.zeebe.process.test.assertions.BpmnAssert.assertThat;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.AUTOMATED_TESTS_PROCESS_ID;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.AUTOMATED_TESTS_RESOURCE_NAME;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.AUTOMATED_TESTS_RUN_TESTS;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.DEPLOY_SNAPSHOT;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.MAKE_CHANGES;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.MERGE_CODE;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.PR_CREATED_MSG;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.PR_ID_VAR;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.REMIND_REVIEWER;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.REQUEST_REVIEW;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.RESOURCE_NAME;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.REVIEW_RECEIVED_MSG;
import static io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackPRCreated.REVIEW_RESULT_VAR;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.AUTOMATED_TESTS_PROCESS_ID;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.AUTOMATED_TESTS_RESOURCE_NAME;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.AUTOMATED_TESTS_RUN_TESTS;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.DEPLOY_SNAPSHOT;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.MAKE_CHANGES;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.MERGE_CODE;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.PR_CREATED_MSG;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.PR_ID_VAR;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.REMIND_REVIEWER;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.REQUEST_REVIEW;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.RESOURCE_NAME;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.REVIEW_RECEIVED_MSG;
import static io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackPRCreated.REVIEW_RESULT_VAR;

import io.camunda.zeebe.client.ZeebeClient;
import io.camunda.zeebe.client.api.response.DeploymentEvent;
import io.camunda.zeebe.client.api.response.PublishMessageResponse;
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import java.time.Duration;
import java.util.Map;
import java.util.Collections;
import java.util.concurrent.TimeoutException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -73,12 +73,17 @@ void testPRCreateddHappyPath() throws InterruptedException, TimeoutException {
// Given
final String prId = "123";
final PublishMessageResponse prCreatedResponse =
Utilities.sendMessage(engine, client, PR_CREATED_MSG, "", Map.of(PR_ID_VAR, prId));
Utilities.sendMessage(
engine, client, PR_CREATED_MSG, "", Collections.singletonMap(PR_ID_VAR, prId));

// When
completeTask(REQUEST_REVIEW);
Utilities.sendMessage(
engine, client, REVIEW_RECEIVED_MSG, prId, Map.of(REVIEW_RESULT_VAR, "approved"));
engine,
client,
REVIEW_RECEIVED_MSG,
prId,
Collections.singletonMap(REVIEW_RESULT_VAR, "approved"));
completeTask(AUTOMATED_TESTS_RUN_TESTS);
completeTask(AUTOMATED_TESTS_RUN_TESTS);
completeTask(AUTOMATED_TESTS_RUN_TESTS);
Expand All @@ -103,7 +108,8 @@ void testRemindReviewer() throws InterruptedException, TimeoutException {
// Given
final String prId = "123";
final PublishMessageResponse prCreatedResponse =
Utilities.sendMessage(engine, client, PR_CREATED_MSG, "", Map.of(PR_ID_VAR, prId));
Utilities.sendMessage(
engine, client, PR_CREATED_MSG, "", Collections.singletonMap(PR_ID_VAR, prId));

// When
completeTask(REQUEST_REVIEW);
Expand All @@ -113,7 +119,11 @@ void testRemindReviewer() throws InterruptedException, TimeoutException {
Utilities.increaseTime(engine, Duration.ofDays(1));
completeTask(REMIND_REVIEWER);
Utilities.sendMessage(
engine, client, REVIEW_RECEIVED_MSG, prId, Map.of(REVIEW_RESULT_VAR, "approved"));
engine,
client,
REVIEW_RECEIVED_MSG,
prId,
Collections.singletonMap(REVIEW_RESULT_VAR, "approved"));
completeTask(MERGE_CODE);
completeTask(DEPLOY_SNAPSHOT);

Expand All @@ -131,19 +141,28 @@ void testRejectReview() throws InterruptedException, TimeoutException {
// Given
final String prId = "123";
final PublishMessageResponse prCreatedResponse =
Utilities.sendMessage(engine, client, PR_CREATED_MSG, "", Map.of(PR_ID_VAR, prId));
Utilities.sendMessage(
engine, client, PR_CREATED_MSG, "", Collections.singletonMap(PR_ID_VAR, prId));

// When
completeTask(REQUEST_REVIEW);
completeTask(AUTOMATED_TESTS_RUN_TESTS);
completeTask(AUTOMATED_TESTS_RUN_TESTS);
completeTask(AUTOMATED_TESTS_RUN_TESTS);
Utilities.sendMessage(
engine, client, REVIEW_RECEIVED_MSG, prId, Map.of(REVIEW_RESULT_VAR, "rejected"));
engine,
client,
REVIEW_RECEIVED_MSG,
prId,
Collections.singletonMap(REVIEW_RESULT_VAR, "rejected"));
completeTask(MAKE_CHANGES);
completeTask(REQUEST_REVIEW);
Utilities.sendMessage(
engine, client, REVIEW_RECEIVED_MSG, prId, Map.of(REVIEW_RESULT_VAR, "approved"));
engine,
client,
REVIEW_RECEIVED_MSG,
prId,
Collections.singletonMap(REVIEW_RESULT_VAR, "approved"));
completeTask(MERGE_CODE);
completeTask(DEPLOY_SNAPSHOT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.inspections.InspectionUtility;
import io.camunda.zeebe.process.test.inspections.model.InspectedProcessInstance;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackTimerStartEvent;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackTimerStartEvent;
import java.time.Duration;
import java.util.Optional;
import org.assertj.core.api.Assertions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import io.camunda.zeebe.process.test.assertions.BpmnAssert;
import io.camunda.zeebe.process.test.inspections.InspectionUtility;
import io.camunda.zeebe.process.test.inspections.model.InspectedProcessInstance;
import io.camunda.zeebe.process.test.qa.util.Utilities;
import io.camunda.zeebe.process.test.qa.util.Utilities.ProcessPackCallActivity;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities;
import io.camunda.zeebe.process.test.qa.abstracts.util.Utilities.ProcessPackCallActivity;
import java.util.Optional;
import java.util.concurrent.TimeoutException;
import org.assertj.core.api.Assertions;
Expand Down
Loading

0 comments on commit 7fd4330

Please sign in to comment.