Test class 'TestClass' is not constructable because it is not 'public'

Working with multimodule. Test dependencies were written in buildSrc module. The plug-in created by the domain module is being used.

This error occurs in the test class. ( junit 5)

What’s wrong?

That question has nothing to do with Gradle.

JUnit Jupiter obviously requires that you make the class and method public but they are not.

If anyone faces the issue: for me, the problem was that IntelliJ added an import for JUnit 4’s @Test instead of JUnit 5’s.

This was due to Testcontainers 1.x requiring JUnit 4 on the classpath (I’m actually using Maven so I don’t know if the same happens with Gradle).

JUnit Jupiter does not require test classes and methods to be public (as opposed to what @Vampire said).

That was just a conclusion of what was written.
OP said it is a JUnit 5 Test, most probably meaning it is a JUnit Jupiter test.
If it does not have the Jupiter annotation, it is not a Jupiter test.

But either way, the question remains off-topic, as it has nothing to do with Gradle other than Gradle being used to build it.

If it were on-topic, I would have recommended to use Spock again, as with that testing suddenly turns from a burden to being fun. :smiley: