Skip to content
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

Add junit5 dependency #180

Merged
merged 1 commit into from
Feb 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
9 changes: 7 additions & 2 deletions binder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ dependencies {
implementation libs.rxkotlin
implementation libs.kotlin.stdlib

testImplementation libs.junit
testImplementation libs.kotlin.test.junit
testImplementation libs.junit5
testImplementation libs.junit.params
testImplementation libs.junit.platform.launcher
testImplementation libs.mockito.kotlin
}

Expand All @@ -24,3 +25,7 @@ compileKotlin {
jvmTarget = JavaVersion.VERSION_11
}
}

test {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion binder/src/test/java/com/badoo/binder/BinderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.badoo.binder.connector.Connector
import io.reactivex.Observable
import io.reactivex.ObservableSource
import io.reactivex.subjects.PublishSubject
import org.junit.Test
import org.junit.jupiter.api.Test

class BinderTest {

Expand Down
3 changes: 1 addition & 2 deletions binder/src/test/java/com/badoo/binder/LifecycleTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import com.badoo.binder.lifecycle.ManualLifecycle
import io.reactivex.ObservableSource
import io.reactivex.functions.Consumer
import io.reactivex.subjects.PublishSubject
import org.junit.Test
import org.junit.jupiter.api.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.mock
import org.mockito.kotlin.times
import org.mockito.kotlin.verify


class LifecycleTest {

private val lifecycle: ManualLifecycle = Lifecycle.manual()
Expand Down
2 changes: 1 addition & 1 deletion binder/src/test/java/com/badoo/binder/TestConsumer.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.badoo.binder

import io.reactivex.functions.Consumer
import kotlin.test.assertEquals
import org.junit.jupiter.api.Assertions.assertEquals

class TestConsumer<T> : Consumer<T> {
val values = mutableListOf<T>()
Expand Down
5 changes: 5 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ gsonVersion = "2.8.5"

# Testing
junitVersion = "4.12"
junit5Version = "5.9.2"
junitPlatformLauncherVersion = "1.9.2"
supportTestVersion = "1.3.0"
mockitoKotlinVersion = "4.0.0"

Expand Down Expand Up @@ -81,6 +83,9 @@ gson = { module = "com.google.code.gson:gson", version.ref = "gsonVersion" }

# Testing
junit = { module = "junit:junit", version.ref = "junitVersion" }
junit5 = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit5Version" }
junit-params = { module = "org.junit.jupiter:junit-jupiter-params", version = "junit5Version"}
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junitPlatformLauncherVersion" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinVersion" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockitoKotlinVersion" }
androidx-test-runner = { module = "androidx.test:runner", version.ref = "supportTestVersion" }
Expand Down
16 changes: 14 additions & 2 deletions mvicore-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}

testOptions {
unitTests {
all {
useJUnitPlatform()
}
}
}

}

dependencies {
Expand All @@ -45,8 +54,11 @@ dependencies {
implementation libs.rxkotlin
implementation libs.rxandroid

testImplementation libs.junit
testImplementation libs.kotlin.test.junit
testImplementation libs.junit5
testImplementation libs.junit.params
testImplementation libs.junit.platform.launcher

androidTestImplementation libs.junit
androidTestImplementation libs.androidx.test.runner
androidTestImplementation libs.androidx.test.rules

Expand Down
Loading