temporalio / temporalio/sdk-java

Support for ManualCompletion in TestActivity Env

Open
#2,573 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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();
  1. Error: Method temporal.api.workflowservice.v1.WorkflowService/RespondActivityTaskCompleted is unimplemented'
  2. Alternatively, I still couldn't test it with a Test Interceptor based approach. Down the useLocalManualCompletion implementation, 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 ManualActivityCompletionClient in useLocalManualCompletion(). 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.