Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed and moved MatsAnnotatedClass #97

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

staale
Copy link
Contributor

@staale staale commented Jan 9, 2025

The MatsAnnotatedClass Rule/Extension, is meant for use in pure Java tests, not involving Spring, even though it does use Spring internally to wire up the endpoint, and trigger parsing of the Mats annotated classes.

Also moved the Rule/Extension to the unit/jupiter test package respectivly, as this is a more logical place for pure Java test helpers.

staale added 2 commits January 9, 2025 06:19
The MatsAnnotatedClass Rule/Extension, is meant for use in pure Java
tests, not involving Spring, even though it does use Spring internally
to wire up the endpoint, and trigger parsing of the Mats annotated
classes.

Also moved the Rule/Extension to the unit/jupiter test package
respectivly, as this is a more logical place for pure Java test helpers.
While starting on tests, I discovered that the API and consistency of
the API was not ideal for the AbstractMatsAnnotatedClass. Adding new
endpoints via a class, was only possible before the test was executed,
and adding actual instances only worked after the test starts.

Changed so that instead one can now add both classes and instances
either when declaring the extension, or within individual tests. We
also
now only keep one application context for each test.
@staale staale force-pushed the move-mats-annotated-class branch from 8d68c20 to b184c9d Compare January 9, 2025 13:18
Added example tests for both jUnit and Jupiter showing various ways that
the Extension/Rule can be used.

Also fixed so that AbstractMatsAnnotatedClass will get fields from the
encapsualting class to include in the Spring context, for nested tests
in Jupiter.
@stolsvik stolsvik merged commit 010cd68 into centiservice:main Jan 9, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants