Skip to content

Commit

Permalink
Remove Mockito. from Mockito.verify
Browse files Browse the repository at this point in the history
  • Loading branch information
florina-muntenescu committed Mar 11, 2019
1 parent 2226c80 commit 1d52b4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
21 changes: 10 additions & 11 deletions app/src/test/java/io/plaidapp/ui/HomeViewModelTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import org.junit.Rule
import org.junit.Test
import org.mockito.ArgumentCaptor
import org.mockito.Captor
import org.mockito.Mockito
import org.mockito.MockitoAnnotations

/**
Expand Down Expand Up @@ -154,7 +153,7 @@ class HomeViewModelTest {
fun filtersUpdated_newSources() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)

Expand All @@ -178,7 +177,7 @@ class HomeViewModelTest {
// Given a view model
val sources = mutableListOf<Source>(designerNewsSource)
val homeViewModel = createViewModel(sources)
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)

Expand All @@ -202,7 +201,7 @@ class HomeViewModelTest {
fun sourceClicked_changesSourceActiveState() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)
// Given that filters were updated
Expand All @@ -222,7 +221,7 @@ class HomeViewModelTest {
fun sourceRemoved_swipeDismissable() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)
// Given that filters were updated
Expand All @@ -242,7 +241,7 @@ class HomeViewModelTest {
fun sourceRemoved_notSwipeDismissable() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)
// Given that filters were updated
Expand All @@ -262,7 +261,7 @@ class HomeViewModelTest {
fun filtersRemoved() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)

Expand All @@ -278,7 +277,7 @@ class HomeViewModelTest {
fun filtersChanged_activeSource() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)

Expand All @@ -295,7 +294,7 @@ class HomeViewModelTest {
fun filtersChanged_inactiveSource() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(sourcesRepository).registerFilterChangedCallback(
verify(sourcesRepository).registerFilterChangedCallback(
capture(filtersChangedCallback)
)

Expand All @@ -312,7 +311,7 @@ class HomeViewModelTest {
fun dataLoading() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(dataManager).registerCallback(capture(dataLoadingCallback))
verify(dataManager).registerCallback(capture(dataLoadingCallback))

// When data started loading
dataLoadingCallback.value.dataStartedLoading()
Expand All @@ -326,7 +325,7 @@ class HomeViewModelTest {
fun dataFinishedLoading() {
// Given a view model
val homeViewModel = createViewModel()
Mockito.verify(dataManager).registerCallback(capture(dataLoadingCallback))
verify(dataManager).registerCallback(capture(dataLoadingCallback))

// When data finished loading
dataLoadingCallback.value.dataFinishedLoading()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import org.junit.Rule
import org.junit.Test
import org.mockito.ArgumentCaptor
import org.mockito.Captor
import org.mockito.Mockito
import org.mockito.MockitoAnnotations

/**
Expand Down Expand Up @@ -86,7 +85,7 @@ class SearchViewModelTest {
@Test
fun dataLoading() {
// Given a view model
Mockito.verify(dataManager).registerCallback(capture(dataLoadingCallback))
verify(dataManager).registerCallback(capture(dataLoadingCallback))

// When data started loading
dataLoadingCallback.value.dataStartedLoading()
Expand All @@ -99,7 +98,7 @@ class SearchViewModelTest {
@Test
fun dataFinishedLoading() {
// Given a view model
Mockito.verify(dataManager).registerCallback(capture(dataLoadingCallback))
verify(dataManager).registerCallback(capture(dataLoadingCallback))

// When data finished loading
dataLoadingCallback.value.dataFinishedLoading()
Expand Down

0 comments on commit 1d52b4e

Please sign in to comment.