Closed cachescrubber closed 7 months ago
Of course it does not feel good to introduce duplicated code en mass, but we need to start somewhere.
UpdateParentMojo#resolveTargetVersion
to DisplayParentUpdatesMojo
.UpdateParentMojoTest
to DisplayParentUpdatesMojoTest
. All tests asserting the actual updates are ignored at the moment. I need to figure out how to assert the actual console output.I added another Test, DisplayParentUpdatesMojoOutputTest
which is based on AbstractMojoTestCase
like all other Display*Tests. As soon as I add a parent to my test-cases pom, test execution will fail with
java.lang.IllegalArgumentException: Invalid repository system session: LocalRepositoryManager is not set.
This is coming from DefaultRepositorySystem::validateSession
, which is usually called -- too bad you didn't provide a stack trace ;) -- from RepositorySystem::resolveVersion
.
You either need to mock the call so that it returns what you want (see e.g. MockUtils
) or just use the regular integration tests (the "it" directory).
Good luck!
Hi @cachescrubber, do you need any more assistance with the failing tests?
@ajarmoniuk I gave up on the *Output test. Instead, I aligned DisplayParentUpdatesMojoOutputTest
(new) with UpdateParentMojoTest
. Could you please review my changes?
@slawekjaranowski please approve the workflow and/or raise additional PR commments.
Resolves #1016