camunda-bpm-assert-scenario | Execute Camunda BPM scenarios and verify | BPM library
kandi X-RAY | camunda-bpm-assert-scenario Summary
Support
Quality
Security
License
Reuse
- Moves the next state of the queue
- Log a warning message
- Marks the phase as being executed
- Runs the scenario
- Initialise the scenario
- Compares two IDs
- Executes the call activity
- Start the execution
- Called when a test case is finished
- Gets the process engine
- Checks if this class supports the specified method
- Get feature name
- Creates a new camel case from the input
- Get a method
- Executes the action
- Get the feature package name
- Returns the signature
- Notifies the risk assignment
- Formats the log message
camunda-bpm-assert-scenario Key Features
camunda-bpm-assert-scenario Examples and Code Snippets
@Test public void testHappyPath() { // "given" part of the test when(process.waitsAtUserTask("CompleteWork")).thenReturn( (task) -> task.complete() ); // "when" part of the test run(process).startByKey("ReadmeProcess").execute(); // "then" part of the test verify(process).hasFinished("WorkFinished"); }
@Test public void testSlowPath() { when(process.waitsAtUserTask("CompleteWork")).thenReturn( (task) -> task.defer("P2DT12H", () -> task.complete()) ); when(process.waitsAtUserTask("RemindColleague")).thenReturn( (task) -> task.complete() ); run(process).startByKey("ReadmeProcess").execute(); verify(process).hasFinished("WorkFinished"); verify(process, times(2)).hasFinished("ColleagueReminded"); }
@Mock private ProcessScenario insuranceApplication; ... @Before public void defineHappyScenario() { when(insuranceApplication.waitsAtUserTask("UserTaskDecideAboutApplication")).thenReturn((task) -> taskService.complete(task.getId(), Variables.putValue("approved", true)) ); }
@Test public void testHappyPath() { Scenario.run(insuranceApplication).startByKey("InsuranceApplication").execute(); ... }
@Test public void testHappyPath() { // WHEN we execute the scenario with the default, "happy" waitstate behaviour ... Scenario.run(insuranceApplication).startByKey("InsuranceApplication").execute(); // THEN we expect the process instance to finish with a "happy" end, the application being accepted ... verify(insuranceApplication).hasFinished("EndEventApplicationAccepted"); }
... | Started receiveTask 'Wait for documents' (ReceiveTaskWaitForDocuments @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) * Acting on receiveTask 'Wait for documents' (ReceiveTaskWaitForDocuments @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Deferring action on 'Wait for documents' until 2017-01-25 18:10:21 (ReceiveTaskWaitForDocuments @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4 ... | Fast-forwarding scenario to 2017-01-19 18:09:21 |-- Executing timer-transition (BoundaryEventDaily @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Started boundaryTimer 'daily' (BoundaryEventDaily @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Completed boundaryTimer 'daily' (BoundaryEventDaily @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Started sendTask 'Send reminder' (SendTaskSendReminder @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) * Acting on sendTask 'Send reminder' (SendTaskSendReminder @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Completed sendTask 'Send reminder' (SendTaskSendReminder @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Started noneEndEvent 'Reminder sent' (EndEvent_1 @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Completed noneEndEvent 'Reminder sent' (EndEvent_1 @ DocumentRequest # dad1fecf-dda0-11e6-906e-7ebec62e68c4) | Fast-forwarding scenario to 2017-01-20 18:09:21 |-- Executing timer-transition (BoundaryEvent_2 @ InsuranceApplication # dacca880-dda0-11e6-906e-7ebec62e68c4) | Started boundaryTimer '2 days' (BoundaryEvent_2 @ InsuranceApplication # dacca880-dda0-11e6-906e-7ebec62e68c4) | Completed boundaryTimer '2 days' (BoundaryEvent_2 @ InsuranceApplication # dacca880-dda0-11e6-906e-7ebec62e68c4) | Started userTask 'Speed up manual check' (UserTaskSpeedUpManualCheck @ InsuranceApplication # dacca880-dda0-11e6-906e-7ebec62e68c4) ...
Trending Discussions on camunda-bpm-assert-scenario
Trending Discussions on camunda-bpm-assert-scenario
QUESTION
I want to use camunda-bpm-assert-scenario in my ScalaTests.
There I have this code with receiveTask::receive
:
when(documentRequest.waitsAtReceiveTask("ReceiveTaskWaitForDocuments")).thenReturn((receiveTask) -> {
receiveTask.defer("P1DT1M", receiveTask::receive);
});
According to answer in Is it possible to use a Java 8 style method references in Scala? I can translate this quite easily to:
receiveTask.defer("P1D", receiveTask.receive _)
But this gives me:
Error:(84, 45) type mismatch;
found : Unit
required: org.camunda.bpm.scenario.defer.Deferred
receiveTask.defer("P1D", receiveTask.receive _)
This is the receive
function:
void receive();
And here is the expected interface:
public interface Deferred {
void execute() throws Exception;
}
How can I achieve this in Scala? This is not a duplicate of Is it possible to use a Java 8 style method references in Scala?, there is no solution to "Error:(84, 45) type mismatch; ..."
ANSWER
Answered 2019-Sep-03 at 08:20After reading this stackoverflow answer, I could solve it to:
receiveTask.defer("P1D", new Deferred{
def execute(): Unit = receiveTask.receive()
})
Intellij proposed then to convert it to a Single Abstract Method:
receiveTask.defer("P1D", () => receiveTask.receive())
The problem was that receive
had also an overloaded function that takes a parameter.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install camunda-bpm-assert-scenario
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page