Skip to content

Use one and modern Mockito version in whole project #2271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ goPluginVersion=231.8109.175
junit5Version=5.8.2
junit4Version=4.13.2
junit4PlatformVersion=1.9.0
mockitoVersion=3.5.13
mockitoVersion=5.2.0
mockitoInlineVersion=5.2.0
ksmtVersion=0.4.3
sootVersion=4.4.0-FORK-2
kotlinVersion=1.8.0
Expand Down Expand Up @@ -59,7 +60,6 @@ kryoVersion=5.4.0
kryoSerializersVersion=0.45
asmVersion=9.2
testNgVersion=7.6.0
mockitoInlineVersion=4.0.0
kamlVersion = 0.51.0
jacksonVersion = 2.12.3
slf4jVersion=1.7.36
Expand Down
2 changes: 1 addition & 1 deletion utbot-framework-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {
implementation group: 'org.jacoco', name: 'org.jacoco.report', version: jacocoVersion
implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsTextVersion
// we need this for construction mocks from composite models
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
implementation group: 'org.mockito', name: 'mockito-core', version: mockitoVersion

// To use JUnit4, comment out JUnit5 and uncomment JUnit4 dependencies here. Please also check "test" section
// testImplementation group: 'junit', name: 'junit', version: '4.13.1'
Expand Down
2 changes: 1 addition & 1 deletion utbot-framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
implementation group: 'org.jacoco', name: 'org.jacoco.report', version: jacocoVersion
implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsTextVersion
// we need this for construction mocks from composite models
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
implementation group: 'org.mockito', name: 'mockito-core', version: mockitoVersion

// To use JUnit4, comment out JUnit5 and uncomment JUnit4 dependencies here. Please also check "test" section
//implementation group: 'junit', name: 'junit', version: '4.13.1'
Expand Down
6 changes: 4 additions & 2 deletions utbot-instrumentation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ val kryoVersion: String by rootProject
val kryoSerializersVersion: String by rootProject
val kotlinLoggingVersion: String by rootProject
val rdVersion: String by rootProject
val mockitoVersion: String by rootProject
val mockitoInlineVersion: String by rootProject
val springBootVersion: String by rootProject

plugins {
Expand Down Expand Up @@ -57,8 +59,8 @@ dependencies {
implementation("net.java.dev.jna:jna-platform:5.5.0")

// TODO: this is necessary for inline classes mocking in UtExecutionInstrumentation
implementation("org.mockito:mockito-core:4.2.0")
implementation("org.mockito:mockito-inline:4.2.0")
implementation("org.mockito:mockito-core:$mockitoVersion")
implementation("org.mockito:mockito-inline:$mockitoInlineVersion")

compileOnly("org.springframework.boot:spring-boot:$springBootVersion")
fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun jUnit5ParametrizedTestsLibraryDescriptor(versionInProject: Version?): Extern
}

fun mockitoCoreLibraryDescriptor(versionInProject: Version?): ExternalLibraryDescriptor {
val preferredVersion = if (versionInProject?.hasNumericOrEmptyPatch() == true) versionInProject?.plainText else "4.2.0"
val preferredVersion = if (versionInProject?.hasNumericOrEmptyPatch() == true) versionInProject?.plainText else "5.2.0"
return ExternalLibraryDescriptor(
"org.mockito", "mockito-core",
"3.5.0", null, preferredVersion
Expand Down
4 changes: 2 additions & 2 deletions utbot-junit-contest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ dependencies {
implementation group: 'org.jsoup', name: 'jsoup', version: '1.6.2'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1'
// need for tests
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
implementation group: 'org.mockito', name: 'mockito-inline', version: '4.2.0'
implementation group: 'org.mockito', name: 'mockito-core', version: mockitoVersion
implementation group: 'org.mockito', name: 'mockito-inline', version: mockitoInlineVersion
implementation 'junit:junit:4.13.2'
testImplementation fileTree(dir: 'src/main/resources/projects/', include: '*/*.jar')
testImplementation files('src/main/resources/evosuite/evosuite-1.2.0.jar')
Expand Down
2 changes: 1 addition & 1 deletion utbot-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies {
implementation group: 'org.jetbrains', name: 'annotations', version: '16.0.2'
implementation group: 'com.github.stephenc.findbugs', name: 'findbugs-annotations', version: '1.3.9-1'
implementation 'org.projectlombok:lombok:1.18.20'
testImplementation 'org.mockito:mockito-core:4.2.0'
testImplementation group: 'org.mockito', name:'mockito-core', version: mockitoVersion
annotationProcessor 'org.projectlombok:lombok:1.18.20'
implementation(project(":utbot-api"))
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
Expand Down
2 changes: 1 addition & 1 deletion utbot-summary/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ dependencies {
implementation(group = "com.github.haifengl", name = "smile-core", version = "2.6.0")
implementation(group = "io.github.microutils", name = "kotlin-logging", version = kotlinLoggingVersion)
implementation("com.github.javaparser:javaparser-core:3.22.1")
testImplementation("org.mockito:mockito-core:4.2.0")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junit5Version")
}
2 changes: 1 addition & 1 deletion utbot-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
implementation group: 'org.jacoco', name: 'org.jacoco.report', version: jacocoVersion
implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsTextVersion
// we need this for construction mocks from composite models
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
implementation group: 'org.mockito', name: 'mockito-core', version: mockitoVersion

// To use JUnit4, comment out JUnit5 and uncomment JUnit4 dependencies here. Please also check "test" section
// testImplementation group: 'junit', name: 'junit', version: '4.13.1'
Expand Down