File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/main/java/org/mockito Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 176
176
* to function without an explicit setup to enable instrumentation, and the JVM will always display a warning.
177
177
*
178
178
* <p>
179
- * To explicitly attach Mockito during test execution, the library's jar file needs to be specified as ` -javaagent`
179
+ * To explicitly attach Mockito during test execution, the library's jar file needs to be specified as <code> -javaagent</code>
180
180
* as an argument to the executing JVM. To enable this in Gradle, the following example adds Mockito to all test
181
181
* tasks:
182
182
*
183
183
* <pre class="code"><code class="kotlin">
184
184
* val mockitoAgent = configurations.create("mockitoAgent")
185
185
* dependencies {
186
- * mockitoAgent(libs.mockito)
186
+ * testImplementation(libs.mockito)
187
+ * mockitoAgent(libs.mockito) { isTransitive = false }
187
188
* }
188
189
* tasks {
189
190
* test {
192
193
* }
193
194
* </code></pre>
194
195
*
196
+ * Supposing <code>Mockito</code> is declared in the version catalog as the following
197
+ *
198
+ * <pre class="code"><code class="toml">
199
+ * [versions]
200
+ * mockito = "5.14.0"
201
+ *
202
+ * [libraries]
203
+ * mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }
204
+ * </code></pre>
205
+ *
195
206
* To add Mockito as an agent to Maven's surefire plugin, the following configuration is needed:
196
207
*
197
208
* <pre class="code"><code class="xml">
You can’t perform that action at this time.
0 commit comments