Skip to content

Commit

Permalink
Fix compilation errors, update mockito
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkranzler5 committed Dec 14, 2023
1 parent 7a9e9af commit 476606a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.instacart.formula.android.ViewFactory
import com.jakewharton.rxrelay3.BehaviorRelay


abstract class ComposeViewFactory<RenderModel> : ViewFactory<RenderModel> {
abstract class ComposeViewFactory<RenderModel : Any> : ViewFactory<RenderModel> {

override fun create(inflater: LayoutInflater, container: ViewGroup?): FeatureView<RenderModel> {
val view = ComposeView(inflater.context)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.instacart.formula

import com.google.common.truth.Truth.assertThat
import com.nhaarman.mockito_kotlin.mock
import com.nhaarman.mockito_kotlin.spy
import com.nhaarman.mockito_kotlin.whenever
import org.junit.Test
import org.mockito.internal.stubbing.answers.CallsRealMethods
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever

class MockitoFormulaTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Lifecycle
import com.instacart.formula.android.internal.ActivityStoreContextImpl
import com.jakewharton.rxrelay3.PublishRelay
import com.nhaarman.mockito_kotlin.mock
import com.nhaarman.mockito_kotlin.verify
import com.nhaarman.mockito_kotlin.verifyZeroInteractions
import com.nhaarman.mockito_kotlin.whenever
import io.reactivex.rxjava3.core.Observable
import kotlinx.parcelize.Parcelize
import org.junit.Before
import org.junit.Test
import org.mockito.kotlin.mock
import org.mockito.kotlin.verify
import org.mockito.kotlin.verifyNoInteractions
import org.mockito.kotlin.whenever

class ActivityStoreContextTest {
class FakeActivity : FragmentActivity() {
Expand Down Expand Up @@ -58,7 +58,7 @@ class ActivityStoreContextTest {
doSomething()
}

verifyZeroInteractions(activity)
verifyNoInteractions(activity)
}

@Test fun `send event success`() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.instacart.formula.android
import androidx.fragment.app.FragmentActivity
import com.google.common.truth.Truth.assertThat
import com.instacart.formula.android.internal.ActivityStoreFactory
import com.nhaarman.mockito_kotlin.mock
import org.junit.Test
import org.mockito.kotlin.mock

class ActivityStoreFactoryTest {

Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ espresso = "3.4.0"
robolectric = "4.6.1"
lint = "30.0.0"
autoService = "1.0-rc7"
mockito = "5.1.0"

[libraries]
android-gradle = { module = "com.android.tools.build:gradle", version.ref = "android-gradle" }
Expand Down Expand Up @@ -64,8 +65,8 @@ truth = { module = "com.google.truth:truth", version = "1.1.3" }
junit = { module = "junit:junit", version = "4.13.2" }
rxrelays = { module = "com.jakewharton.rxrelay3:rxrelay", version = "3.0.1" }

mockito-inline = { module = "org.mockito:mockito-inline", version = "3.12.4" }
mockito-kotlin = { module = "com.nhaarman:mockito-kotlin", version = "1.6.0" }
mockito-inline = { module = "org.mockito:mockito-inline", version.ref = "mockito" }
mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito" }

lint-core = { module = "com.android.tools.lint:lint", version.ref = "lint" }
lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }
Expand Down
4 changes: 2 additions & 2 deletions samples/stopwatch-coroutines/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ plugins {
}

android {
namespace = "com.instacart.formula.stopwatch.coroutines"
namespace = "com.instacart.formula.stopwatch"

defaultConfig {
applicationId = "com.instacart.formula.stopwatch.coroutines"
applicationId = "com.instacart.formula.stopwatch"
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down

0 comments on commit 476606a

Please sign in to comment.