Issue
I have two different modules in my pom.xml, each of them with its own code. Since both of them will have tests, I was wondering if there would be a way of joining helper functions inside the test folders(for instance TestUtils). This TestUtils would then be able to be called from other modules. The issue appears to be that the tests in other modules will not be able to import this TestUtils.
Solution
You can create an additional module test-helper
that gathers the common test methods. Then you define a dependency with scope test
on this module in the other modules.
In this way, the other modules can use the helper methods without copy/paste.
Answered By - J Fabian Meier
Answer Checked By - Senaida (JavaFixing Volunteer)