Skip to content

Non-root namespaces should be able to use the in-memory test server #2735

@billrich2001

Description

@billrich2001

Expected Behavior

Non-root namespaces should be able to use the in-memory test server when spring.temporal.test-server.enabled=true is configured, just like the root namespace does.

Actual Behavior

Non-root namespaces cannot use the in-memory test server due to a bean name/type mismatch in Spring autoconfiguration. Instead of using TestWorkflowEnvironment, the configuration creates a client connecting to the dev server when multiple namespaces are used.

Steps to Reproduce the Problem

Example

  1. Configure Spring Boot application with spring.temporal.test-server.enabled=true
  2. Set up multiple namespaces (root and non-root namespaces)
  3. Attempt to run tests with non-root namespaces
  4. Observe that non-root namespaces connect to dev server instead of in-memory test server

Specifications

  • Version: Temporal Java SDK v1.30.0+
  • Platform: Spring Boot with Temporal Spring Boot Autoconfigure

Root Cause: The issue appears to be in NonRootBeanPostProcessor where there's a name/type mismatch:

testWorkflowEnvironment = findBean("temporalTestWorkflowEnvironment", TestWorkflowEnvironmentAdapter.class);

However, TestServerAutoConfiguration registers:

  • "temporalTestWorkflowEnvironment" as a TestWorkflowEnvironment
  • "temporalTestWorkflowEnvironmentAdapter" as a TestWorkflowEnvironmentAdapter

The code is looking for a TestWorkflowEnvironmentAdapter with the wrong bean name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions