diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e4cc837d3b..b4d700c3c1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -bytebuddy = "1.15.2" +bytebuddy = "1.15.3" errorprone = "2.23.0" junit-jupiter = "5.11.0" junit-platform = "1.11.1" diff --git a/src/main/java/org/mockito/Mockito.java b/src/main/java/org/mockito/Mockito.java index b6d47608ec..441b6b2406 100644 --- a/src/main/java/org/mockito/Mockito.java +++ b/src/main/java/org/mockito/Mockito.java @@ -176,14 +176,15 @@ * to function without an explicit setup to enable instrumentation, and the JVM will always display a warning. * *
- * To explicitly attach Mockito during test execution, the library's jar file needs to be specified as `-javaagent`
+ * To explicitly attach Mockito during test execution, the library's jar file needs to be specified as -javaagent
* as an argument to the executing JVM. To enable this in Gradle, the following example adds Mockito to all test
* tasks:
*
*
* val mockitoAgent = configurations.create("mockitoAgent")
* dependencies {
- * mockitoAgent(libs.mockito)
+ * testImplementation(libs.mockito)
+ * mockitoAgent(libs.mockito) { isTransitive = false }
* }
* tasks {
* test {
@@ -192,6 +193,16 @@
* }
*
*
+ * Supposing Mockito
is declared in the version catalog as the following
+ *
+ *
+ * [versions]
+ * mockito = "5.14.0"
+ *
+ * [libraries]
+ * mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }
+ *
+ *
* To add Mockito as an agent to Maven's surefire plugin, the following configuration is needed:
*
*