Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gclaussn committed May 27, 2024
1 parent b9d0824 commit 2548d23
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public void apply(Project project) {
}).get();

// add generator task as test compile dependency
project.afterEvaluate(afterEvaluate -> {
afterEvaluate.getTasksByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME, false).forEach(task -> task.dependsOn(generatorTask));
});
project.afterEvaluate(afterEvaluate ->
afterEvaluate.getTasksByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME, false).forEach(task -> task.dependsOn(generatorTask))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public void apply(Project project) {
}).get();

// add generator task as test compile dependency
project.afterEvaluate(afterEvaluate -> {
afterEvaluate.getTasksByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME, false).forEach(task -> task.dependsOn(generatorTask));
});
project.afterEvaluate(afterEvaluate ->
afterEvaluate.getTasksByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME, false).forEach(task -> task.dependsOn(generatorTask))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
/**
* Abstract superclass for JUnit 5 based test cases.
*/
public abstract class AbstractJUnit5TestCase<T extends AbstractTestCase<?>> extends AbstractTestCase<T>
implements BeforeEachCallback, AfterEachCallback {
public abstract class AbstractJUnit5TestCase<T extends AbstractTestCase<?>> extends AbstractTestCase<T> implements BeforeEachCallback, AfterEachCallback {

@Override
public void beforeEach(ExtensionContext context) {
Expand Down
4 changes: 2 additions & 2 deletions integration-tests-8/advanced-multi-instance.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mvn clean test
Should contain ${result.stdout} Running org.example.it.UserTaskErrorTest
Should contain ${result.stdout} Running org.example.it.UserTaskMessageTest
# tests executed successfully
Should contain ${result.stdout} Failures: 0, Errors: 0, Skipped: 0
Should contain ${result.stdout} Failures: 0, Errors: 0, Skipped: 1

Should be equal as integers ${result.rc} 0

Expand All @@ -43,6 +43,6 @@ gradle clean build
# tests executed
Should contain ${result.stdout} finished executing tests
# tests executed successfully
Should contain ${result.stdout} Failures: 0, Skipped: 0
Should contain ${result.stdout} Failures: 0, Skipped: 1

Should be equal as integers ${result.rc} 0
5 changes: 3 additions & 2 deletions integration-tests-8/advanced.robot
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mvn clean test
Should contain ${result.stdout} Running org.example.it.CallActivityTimerTest
Should contain ${result.stdout} Running org.example.it.CollaborationTest
Should contain ${result.stdout} Running org.example.it.LinkEventTest
Should contain ${result.stdout} Running org.example.it.OutboundConnectorErrorTest
Should contain ${result.stdout} Running org.example.it.ServiceTaskErrorTest
Should contain ${result.stdout} Running org.example.it.ServiceTaskMessageTest
Should contain ${result.stdout} Running org.example.it.ServiceTaskSignalTest
Expand All @@ -31,7 +32,7 @@ mvn clean test
Should contain ${result.stdout} Running org.example.it.UserTaskSignalTest
Should contain ${result.stdout} Running org.example.it.UserTaskTimerTest
# tests executed successfully
Should contain ${result.stdout} Failures: 0, Errors: 0, Skipped: 0
Should contain ${result.stdout} Failures: 0, Errors: 0, Skipped: 1

Should be equal as integers ${result.rc} 0

Expand All @@ -49,6 +50,6 @@ gradle clean build
# tests executed
Should contain ${result.stdout} finished executing tests
# tests executed successfully
Should contain ${result.stdout} Failures: 0, Skipped: 0
Should contain ${result.stdout} Failures: 0, Skipped: 1

Should be equal as integers ${result.rc} 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.example.it;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import generated.outboundconnectorerror.TC_startEvent__endEvent;
import io.camunda.zeebe.process.test.api.ZeebeTestEngine;
import io.camunda.zeebe.process.test.assertions.ProcessInstanceAssert;
import io.camunda.zeebe.process.test.extension.ZeebeProcessTest;

@ZeebeProcessTest
public class OutboundConnectorErrorTest {

@RegisterExtension
TC_startEvent__endEvent tc = new TC_startEvent__endEvent();

ZeebeTestEngine engine;

@Test
void testExecute() {
tc.createExecutor(engine).verify(ProcessInstanceAssert::isCompleted).execute();
}

@Test
void testExecuteAction() {
tc.handleOutboundConnector().execute((client, jobKey) -> client.newThrowErrorCommand(jobKey).errorCode("ADVANCED_ERROR").send());

tc.createExecutor(engine).verify(ProcessInstanceAssert::isCompleted).execute();
}

@Test
void testThrowBpmnError() {
tc.handleOutboundConnector().throwBpmnError("ADVANCED_ERROR", "test error message");

tc.createExecutor(engine).verify(ProcessInstanceAssert::isCompleted).execute();
}
}

0 comments on commit 2548d23

Please sign in to comment.