Skip to content

Commit

Permalink
test: refactored some asserts and set correct parameters in some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joragua committed Dec 10, 2024
1 parent 712db7b commit 4a7ca09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package com.owncloud.android.data.oauth

import com.owncloud.android.data.oauth.datasources.RemoteOAuthDataSource
import com.owncloud.android.data.oauth.repository.OCOAuthRepository
import com.owncloud.android.testutil.OC_SECURE_SERVER_INFO_BASIC_AUTH
import com.owncloud.android.testutil.OC_SECURE_SERVER_INFO_OIDC_AUTH
import com.owncloud.android.testutil.oauth.OC_CLIENT_REGISTRATION
import com.owncloud.android.testutil.oauth.OC_CLIENT_REGISTRATION_REQUEST
import com.owncloud.android.testutil.oauth.OC_OIDC_SERVER_CONFIGURATION
Expand All @@ -44,14 +44,14 @@ class OCOAuthRepositoryTest {
@Test
fun `performOIDCDiscovery returns an OIDCServerConfiguration`() {
every {
remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl)
remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_OIDC_AUTH.baseUrl)
} returns OC_OIDC_SERVER_CONFIGURATION

val oidcServerConfiguration = oAuthRepository.performOIDCDiscovery(OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl)
val oidcServerConfiguration = oAuthRepository.performOIDCDiscovery(OC_SECURE_SERVER_INFO_OIDC_AUTH.baseUrl)
assertEquals(OC_OIDC_SERVER_CONFIGURATION, oidcServerConfiguration)

verify(exactly = 1) {
remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_BASIC_AUTH.baseUrl)
remoteOAuthDataSource.performOIDCDiscovery(OC_SECURE_SERVER_INFO_OIDC_AUTH.baseUrl)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class OCShareRepositoryTest {
} returns sharesLiveDataList

val sharesResult = ocShareRepository.getSharesAsLiveData(filePath, OC_ACCOUNT_NAME)
assertEquals(sharesResult, sharesLiveDataList)
assertEquals(sharesLiveDataList, sharesResult)

verify(exactly = 1) {
localShareDataSource.getSharesAsLiveData(
Expand All @@ -218,7 +218,7 @@ class OCShareRepositoryTest {
} returns shareLiveData

val shareResult = ocShareRepository.getShareAsLiveData(OC_SHARE.remoteId)
assertEquals(shareResult, shareLiveData)
assertEquals(shareLiveData, shareResult)

verify(exactly = 1) {
localShareDataSource.getShareAsLiveData(OC_SHARE.remoteId)
Expand Down

0 comments on commit 4a7ca09

Please sign in to comment.