Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion mockito-core/src/main/java/org/mockito/Mockito.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
* <p>
* To explicitly attach Mockito during test execution, the library's jar file needs to be specified as <code>-javaagent</code>
* as an argument to the executing JVM. To enable this in Gradle, the following example adds Mockito to all test
* tasks:
* tasks using <strong>Kotlin DSL</strong>:
*
* <pre class="code"><code class="kotlin">
* val mockitoAgent = configurations.create("mockitoAgent")
Expand All @@ -193,6 +193,24 @@
* }
* </code></pre>
*
* The same can be achieved using <strong>Groovy DSL</strong>:
*
* <pre class="code"><code class="groovy">
* configurations {
* mockitoAgent
* }
* dependencies {
* mockitoAgent(libs.mockito) {
* transitive = false
* }
* }
* tasks {
* test {
* jvmArgs += "-javaagent:${configurations.mockitoAgent.asPath}"
* }
* }
* </code></pre>
*
* Supposing <code>Mockito</code> is declared in the version catalog as the following
*
* <pre class="code"><code class="toml">
Expand Down
Loading