I'm using junit5 via ```testImplementation(kotlin(...
# getting-started
e
I'm using junit5 via
Copy code
testImplementation(kotlin("test"))
now I need the parameterizedTest Annotation present in
org.junit.jupiter:junit-jupiter-params
, is there a programmatic way to have its version in sync with the other components brought in by the previous line? At the moment I'm simply looking in the deps and manually appending the version (
5.10.0
atm)
j
Why do you want them on sync?
e
because I assume otherwise things will screw up
am I wrong?
j
I haven’t had any problem using the last version of jupiter.
e
apparently me neither so far, but I've a feeling this might bite me back in the next future
s
If you're worried about keeping things in sync you can always apply the junit BOM:
Copy code
testImplementation(platform("org.junit:junit-bom:5.10.0"))
e
yeah, but this way I'm weighing in with 5.10.0 myself, it's a perfectly legit solution, don't get me wrong, but I was wondering if there was a (quick) way to align to whatever brought by
kotlin("test")
but I guess I'll end up doing that, thanks!
k
If you are not actually using the
kotlin.test
framework, why are you importing the JUnit framework as a transitive dependency when you actually want to use it directly? Currently you've got:
Copy code
testImplementation(kotlin("test"))
and if you check what the
kotlin
function call does, you'll see that the above is the same as:
Copy code
testImplementation("org.jetbrains.kotlin:kotlin-test")
which gets an unspecified (typically latest) version of the
kotlin-test
dependency, which transitively pulls in an old version of JUnit. If you want JUnit, get it directly.
e
I see it's actually pulling 5.10.0