refactor(tests): TestWebAppFactory.CreateClientWithOverrides para DI override scoped (closes #36) #43
Reference in New Issue
Block a user
Delete Branch "fix/issue-36-rsa-singleton-override"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
TestWebAppFactory.CreateClientWithOverrides(Action<IServiceCollection>)— wrapper sobreWithWebHostBuilder+ConfigureTestServices// TODO PRD-002removido enProductTypesControllerTests.csMisdiagnóstico rectificado
El issue #36 asumía RSA singleton sealed como bloqueante, pero
WithWebHostBuildercrea un child host independiente que re-ejecutaConfigureWebHost(carga claves RSA frescas de PEM cada vez). No había leakage cross-host. El verdadero blocker era que ningún test usabaWithWebHostBuilder— todos compartían el mismo cliente root. El fix no rompe JWT signing porque cada override tiene su propia RSA válida.Test plan
dotnet test tests/SIGCM2.Application.Tests/: 1013/1013dotnet test tests/SIGCM2.Api.Tests/: 287 (285 + 2 nuevos)Closes
Closes #36
Siguiente
Patrón
CreateClientWithOverridesdisponible para cualquier UDT que necesite e2e 409/422/404 con DI override (VTA-, FAC-, etc.)Artifacts