elsa-core/test/integration/Elsa.Alterations.IntegrationTests
Rostislav Statko 54c8fda65f
fix(alterations): preserve tenant context for background alteration jobs (#7962)
* Fix tenant context propagation for alteration jobs

Capture the current tenant when dispatching a background alteration job
and restore it while executing the queued callback.

Add regression coverage verifying that the dispatch-time tenant is used
and the worker's previous tenant context is restored.

Fixes #7961

* test(alterations): cover tenant restore on failure and concurrent tenant isolation

Add coverage for the spec lines that were previously untested: the
worker's tenant context is restored after execution even when the
job runner throws, and concurrent jobs dispatched under different
tenants do not exchange tenant context. Extract the shared service
provider / job queue / recording runner arrange logic into
constructor-initialized fields so the three tests stay DRY.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* test(alterations): cover default-tenant dispatch and share dispatcher test setup

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 20:07:36 -07:00
..
Workflows Add integration tests for migration in Elsa.Alterations module 2025-09-28 20:44:55 +02:00
AlterationsApiTimestampFilterTests.cs Address timestamp filter test cleanup review 2026-05-21 02:10:42 +02:00
BackgroundAlterationJobDispatcherTests.cs fix(alterations): preserve tenant context for background alteration jobs (#7962) 2026-09-06 20:07:36 -07:00
Elsa.Alterations.IntegrationTests.csproj Add unit and integration tests for DownloadHttpFile activity (#7094) 2025-11-24 14:37:06 +01:00
EndpointSecurityTestCollection.cs Isolate timestamp filter integration tests 2026-05-21 01:22:22 +02:00
MigrationTests.cs Add integration tests for migration in Elsa.Alterations module 2025-09-28 20:44:55 +02:00
RetrySequenceTests.cs fix: preserve Sequence ownership when retrying child activities (#8027) 2026-09-05 18:42:28 -07:00
Usings.cs Add integration tests for migration in Elsa.Alterations module 2025-09-28 20:44:55 +02:00
WorkflowInstanceFinderTimestampFilterTests.cs Address timestamp filter test cleanup review 2026-05-21 02:10:42 +02:00