Skip to content

Instructions on configuring mockito as agent lacks a Gradle Groovy DSL example (currently only Kotlin DSL) #3519

@EugenMayer

Description

@EugenMayer

Setup

  • mockito: 5.14.2
  • gradle: 8.11.1
  • java: 21
  • linux

Followed the instructions on https://javadoc.io/static/org.mockito/mockito-core/5.14.2/org/mockito/Mockito.html#0.3

my catalog (amongs other things)

[versions]
mockito = "5.14.2"

[libraries]
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito"}
var mockitoAgent = configurations.create("mockitoAgent")

dependencies {
    // java agent based mockito configuration see https://github.com/mockito/mockito/pull/3454
    mockitoAgent(javaDeps.mockito.core) { isTransitive = false }
}

Issue

Running gradle, i get the error for the line mockitoAgent(javaDeps.mockito.core) { isTransitive = false }

Could not find method call() for arguments [map(valueof(DependencyValueSource)), common_dependencies_tests_e6abh55rycnig0zejb3yxvkrs$_run_closure1$_closure3@d78cf57] on configuration ':core:mockitoAgent' of type org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration.

What i tried

I also tried

mockitoAgent("org.mockito:mockito-core:5.14.2") {
        isTransitive = false
}

Assumption

Is it a gradle version incompatibility (gradle 8.11.1) or something else? I'am using groovy

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions