Skip to content

refactor: provide a way to set Config for DependencyInjection tests#5646

Merged
ndr-brt merged 1 commit intomainfrom
5645-set-config-injection-tests
Apr 13, 2026
Merged

refactor: provide a way to set Config for DependencyInjection tests#5646
ndr-brt merged 1 commit intomainfrom
5645-set-config-injection-tests

Conversation

@ndr-brt
Copy link
Copy Markdown
Member

@ndr-brt ndr-brt commented Apr 9, 2026

What this PR changes/adds

Introduce a TestExtensionContext that could be used to set Config before invoking extension instantiation.
This will avoid the need to play with mocks and to provide a clear configuration that will be correctly injected into @Setting and @Configuration annotated fields

Why it does that

testability

Further notes

  • applied the pattern to some tests in order to show how it works, on the long term it could be reasonable to remove the spy wrapper around the service extension context object
  • remove the non-necessary BaseRuntime superclass reference from DependencyInjectionExtension

Who will sponsor this feature?

Please @-mention the committer that will sponsor your feature.

Linked Issue(s)

Closes #5645

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@ndr-brt ndr-brt requested a review from a team as a code owner April 9, 2026 13:19
@ndr-brt ndr-brt added the refactoring Cleaning up code and dependencies label Apr 9, 2026
@ndr-brt ndr-brt force-pushed the 5645-set-config-injection-tests branch from cd5f5f0 to b08c2fc Compare April 9, 2026 13:33
@ndr-brt ndr-brt force-pushed the 5645-set-config-injection-tests branch from b08c2fc to 35584ad Compare April 9, 2026 13:44
@ndr-brt ndr-brt merged commit 19f84cd into main Apr 13, 2026
47 of 50 checks passed
@ndr-brt ndr-brt deleted the 5645-set-config-injection-tests branch April 13, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Cleaning up code and dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DI test] provide a way to set config

2 participants