Skip to content

Commit

Permalink
Merge pull request #3473 from owncloud/tests/update_deprecations
Browse files Browse the repository at this point in the history
[TESTS] Removed deprecations and warnings
  • Loading branch information
abelgardep authored Dec 14, 2021
2 parents a21021c + efa284e commit b9d2ee2
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 124 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* ownCloud Android client application
*
* @author David A. Velasco
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class SortBottomSheetFragmentTest {
putParcelable(SortBottomSheetFragment.ARG_SORT_TYPE, SortType.SORT_TYPE_BY_NAME)
putParcelable(SortBottomSheetFragment.ARG_SORT_ORDER, SortOrder.SORT_ORDER_ASCENDING)
}
fragmentScenario = launchFragment<SortBottomSheetFragment>(fragmentArgs)
fragmentScenario = launchFragment(fragmentArgs)
every { fragmentListener.onSortSelected(any()) } returns Unit
fragmentScenario.onFragment { it.sortDialogListener = fragmentListener }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package com.owncloud.android.settings.security
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.preference.PreferenceManager
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.Espresso.onView
Expand All @@ -34,6 +33,7 @@ import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import com.owncloud.android.R
import com.owncloud.android.db.PreferenceManager
import com.owncloud.android.presentation.ui.security.PassCodeActivity
import com.owncloud.android.utils.matchers.isDisplayed
import com.owncloud.android.utils.matchers.withText
Expand All @@ -47,7 +47,7 @@ import com.owncloud.android.utils.click
import com.owncloud.android.utils.matchers.withChildCountAndId
import io.mockk.every
import io.mockk.mockk
import nthChildOf
import com.owncloud.android.utils.matchers.nthChildOf
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ package com.owncloud.android.settings.security

import android.content.Context
import android.content.Intent
import android.preference.PreferenceManager
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
import com.owncloud.android.R
import com.owncloud.android.db.PreferenceManager
import com.owncloud.android.presentation.ui.security.PatternActivity
import com.owncloud.android.presentation.viewmodels.security.PatternViewModel
import com.owncloud.android.testutil.security.OC_PATTERN
Expand Down Expand Up @@ -70,13 +70,13 @@ class PatternActivityTest {

@After
fun tearDown() {
//Clean preferences
// Clean preferences
PreferenceManager.getDefaultSharedPreferences(context).edit().clear().commit()
}

@Test
fun patternLockView() {
//Open Activity in pattern creation mode
// Open Activity in pattern creation mode
openPatternActivity(PatternActivity.ACTION_REQUEST_WITH_RESULT)

with(R.id.header_pattern) {
Expand All @@ -93,10 +93,10 @@ class PatternActivityTest {

@Test
fun removePatternLock() {
//Save a pattern in Preferences
// Save a pattern in Preferences
storePattern()

//Open Activity in pattern deletion mode
// Open Activity in pattern deletion mode
openPatternActivity(PatternActivity.ACTION_CHECK_WITH_RESULT)

with(R.id.header_pattern) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.owncloud.android.sharing.sharees.ui

import android.content.Context
import androidx.lifecycle.MutableLiveData
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
Expand Down Expand Up @@ -61,7 +60,7 @@ class SearchShareesFragmentTest {
stopKoin()

startKoin {
androidContext(ApplicationProvider.getApplicationContext<Context>())
androidContext(ApplicationProvider.getApplicationContext())
modules(
module(override = true) {
viewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.owncloud.android.sharing.shares.ui

import android.content.Context
import androidx.lifecycle.MutableLiveData
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
Expand Down Expand Up @@ -70,7 +69,7 @@ class EditPrivateShareFragmentTest {
stopKoin()

startKoin {
androidContext(ApplicationProvider.getApplicationContext<Context>())
androidContext(ApplicationProvider.getApplicationContext())
modules(
module(override = true) {
viewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.owncloud.android.sharing.shares.ui

import android.content.Context
import androidx.lifecycle.MutableLiveData
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
Expand Down Expand Up @@ -85,7 +84,7 @@ class PublicShareEditionDialogFragmentTest {
stopKoin()

startKoin {
androidContext(ApplicationProvider.getApplicationContext<Context>())
androidContext(ApplicationProvider.getApplicationContext())
modules(
module(override = true) {
viewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package com.owncloud.android.sharing.shares.ui

import android.content.Context
import androidx.lifecycle.MutableLiveData
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
Expand Down Expand Up @@ -71,7 +70,7 @@ class ShareFileFragmentTest {
stopKoin()

startKoin {
androidContext(ApplicationProvider.getApplicationContext<Context>())
androidContext(ApplicationProvider.getApplicationContext())
modules(
module(override = true) {
viewModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

package com.owncloud.android.sharing.shares.ui

import android.content.Context
import androidx.lifecycle.MutableLiveData
import androidx.test.core.app.ActivityScenario
import androidx.test.core.app.ApplicationProvider
Expand Down Expand Up @@ -65,7 +64,7 @@ class ShareFolderFragmentTest {
stopKoin()

startKoin {
androidContext(ApplicationProvider.getApplicationContext<Context>())
androidContext(ApplicationProvider.getApplicationContext())
modules(
module(override = true) {
viewModel {
Expand Down
Loading

0 comments on commit b9d2ee2

Please sign in to comment.