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

Proper mocking for tests of version range resolution #16

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

johannesduesing
Copy link
Member

@johannesduesing johannesduesing commented Jan 27, 2025

This PR addresses the issue of tests failing when new releases of certain libraries are published to Maven Central. Instead of using actual real-world data to conduct the test case for parsing version ranges, we now use fixed test data from the PomInputs.json file. While at it, i introduced the IReleaseListProvider interface that encapsulates the retrieval of version lists, so it can be properly mocked during testing.

I made sure i removed all invocations of DefaultMavenReleaseListProvider during testing, so we should at no point be dependent on live release data anymore - i dumped the real world release list "as of now", added them to the JSON test data files and used them as a ground truth for future testing.

@johannesduesing johannesduesing added the enhancement New feature or request label Jan 27, 2025
@johannesduesing johannesduesing self-assigned this Jan 27, 2025
@johannesduesing johannesduesing marked this pull request as draft January 27, 2025 15:49
@johannesduesing johannesduesing marked this pull request as ready for review January 27, 2025 16:44
@jachiaram jachiaram merged commit cea390b into main Jan 31, 2025
1 check passed
@johannesduesing johannesduesing deleted the feature/mock-version-range-tests branch January 31, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants