Sorry, I know this is more a question than an issue, but I got confused by some objections I had to face on testing in a modular context that I want to be cleared :)
Let's suppose we have the following project structure:
src/
main/
java/
my.library/
internals/
Internal.java
Util.java
module-info.java
with the following module-info
:
module my.library {
exports my.library;
}
In order to make tests on Internal.java
as well, I have to define another module-info
with the following project structure for test
folder only, and fix the original module-info
:
src/
main/
java/
my.library.test/ <<<<< pay attention
internals/
InternalTest.java
UtilTest.java
module-info.java
with the following module-info
:
open module my.library.test {
requires my.library;
requires // junit, assert4j, ...
}
with the fix for the original module-info
:
module my.library {
exports my.library;
exports my.library.internals to my.library.test;
}
Do you know if there is any evident issue with this approach? Unfortunately, this is the only way I found to make IntelliJ happy.
Thank you in advance for any reply!