temporalio / temporalio/sdk-java
Support for ManualCompletion in TestActivity Env
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
Is your feature request related to a problem? Please describe.
Testing an Activity in isolation is feasible with the TestActivityEnvironment. However is a challenge when using ManualActivityCompletionClient
var manualActivityCompletionClient =
Activity.getExecutionContext().useLocalManualCompletion();
- Error: Method temporal.api.workflowservice.v1.WorkflowService/RespondActivityTaskCompleted is unimplemented'
- Alternatively, I still couldn't test it with a Test Interceptor based approach. Down the
useLocalManualCompletionimplementation, it returns new clients, so unable to mock.
Describe the solution you'd like
Either
- support to test with ManualCompletionClient (or)
- ability to return a mock of
ManualActivityCompletionClientinuseLocalManualCompletion(). Maybe a client supplier? (or)
Describe alternatives you've considered
- tried interceptor approach to test and with
TestEnvironment
Additional context
- or should we discourage usage of ManualCompletionClient in java docs .
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TestActivityEnvironment and the Activity.getExecutionContext().useLocalManualCompletion() path, then compare it with the Test Interceptor and TestEnvironment approaches described in the issue. Determine whether the intended outcome is ManualActivityCompletionClient support in tests or a mockable client supplier, and define a test that demonstrates the chosen behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100