2

I have been working on creating unit tests which run local versions of a workflow. I followed this guide for an initial setup. With that setup, I have been able to successfully execute and test a workflow. The issue arises when I attempt to unit test an activity implementation that is marked as @ManualActivityCompletion. It appears that the manual completion activities return normally within unit tests (not waiting for a completion/failure call).

I'm wondering if it is even possible to unit tests manual completion activities in this way. My guess is that it is not since I have seen no mention of it and I don't see any way to create a test ManualActivityCompletionClient. In that case, I'm wondering if anyone has any suggestions on how to unit test manual completion activities in a local workflow. I have attempted to create workarounds to this by using different threads and synch points, but it is useful to test with the actual behavior of completing/failing activities (exceptions that are thrown, etc.). It may be worth mentioning that I have been able to write successful integration unit tests for manual completion activities.

Any help is greatly appreciated.

Nithin
  • 9,661
  • 14
  • 44
  • 67

1 Answers1

0

To test workflow logic that invokes activity marked with @ManualActivityCompletion just mock client side interface of this activity directly. As client executes in the asynchronous context of the workflow you can use Promises and WorkflowClock to implement your tests.

Maxim Fateev
  • 6,458
  • 3
  • 20
  • 35