Mockito Core

org.mockito : mockito-core

Mockito mock objects library core API and implementation

[Website] ·
16k usages
· 12k stars

Add dependency in Maven / Gradle

<dependency>
    <groupId>org.mockito</groupId>
    <artifactId>mockito-core</artifactId>
    <version>4.2.0</version>
</dependency>

How to add dependency in a project

  1. Add dependency to a Maven project
  2. Add dependency to a Gradle project
  3. Add dependency to a SBT Scala project
  4. Add dependency to a Grape project

1. Add dependency to a Maven project

Maven: Add the org.mockito:mockito-core library to the dependencies element of your pom.xml file:

<dependencies>
<dependency>
  <groupId>org.mockito</groupId>
  <artifactId>mockito-core</artifactId>
  <version>4.2.0</version>
</dependency>
</dependencies>

To install org.mockito:mockito-core library use the following command:

mvn install

2. Add dependency to a Gradle project

Gradle Groovy DSL: Add the org.mockito:mockito-core library to the dependencies section of your build.gradle file:

dependencies {
implementation 'org.mockito:mockito-core:4.2.0'
}

Gradle Kotlin DSL: Add the org.mockito:mockito-core library to the dependencies section of your build.gradle.kts file:

dependencies {
implementation("org.mockito:mockito-core:4.2.0")
}

3. Add dependency to a SBT Scala project

Scala: Add the org.mockito:mockito-core library to your build.sbt file:

libraryDependencies += "org.mockito" % "mockito-core" % "4.2.0"

4. Add dependency to a Grape project

Grape: Add an annotation org.mockito:mockito-core library to your groovy script file:

@Grapes(
    @Grab('org.mockito:mockito-core:4.2.0')
)

Compile Dependencies (2)

Group / Artifact Usage
net.bytebuddy » byte-buddy 595
net.bytebuddy » byte-buddy-agent 173

Provided Dependencies (0)

Group / Artifact Usage

Test Dependencies (0)

Group / Artifact Usage