79342228

Date: 2025-01-09 10:24:18
Score: 0.5
Natty:
Report link

Thanks for @prasadu 's answer:

There is ability with testFixtures:

https://docs.gradle.org/current/userguide/java_testing.html#sec:java_test_fixtures

If you use them with *api like in core module:

testFixturesCompileOnlyApi 'asdf:qwer:zxcv'
testFixturesApi 'org.springframework.boot:spring-boot-starter-test'
testFixturesRuntimeOnly 'org.junit.platform:junit-platform-launcher'

And then if you use core module in other modules like:

implementation project(':core')
testImplementation testFixtures(project(':core'))

You can automatically use that tests.

Don't forget to use with:

plugins {
    id 'java-library'
    id 'java-test-fixtures'
}
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @prasadu
Posted by: utrucceh