I am trying to add a JUnit5 test case using TestWorkflowEnvironment in Java. I have mocked the activity that is supposed to get called in the workflow being tested. And it was getting stuck at the line where the activity is invoked and not moving forward. After some time the test case ends but activity invocations were still 0 even after completion. I have tried adding debug point and it is reaching the line where activity gets called but doesn’t go to the next line. Having checked the pending activity status using the DescribeWorkflowExecution, it is PENDING_ACTIVITY_STATE_SCHEDULED. Some help would be appreciated. Thanks!!
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
How can i write tests for workflows in java sdk? | 1 | 28 | July 20, 2025 | |
Mocking workflow within an activity in JUnit 5 tests not working as expected | 0 | 157 | January 28, 2025 | |
Unit test : Junit 5 - mock child workflow failed | 1 | 674 | August 9, 2023 | |
How to write junit test cases in java | 6 | 1143 | August 17, 2023 | |
Throwing exception in mocked activity hangs the test | 7 | 970 | May 15, 2024 |