Skip to content

Commit e5e6e23

Browse files
committed
Tiny CR changes
1 parent a939329 commit e5e6e23

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

owncloudData/src/androidTest/java/com/owncloud/android/data/authentication/datasources/implementation/OCLocalAuthenticationDataSourceTest.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import com.owncloud.android.testutil.OC_ACCOUNT
4747
import com.owncloud.android.testutil.OC_ACCOUNT_ID
4848
import com.owncloud.android.testutil.OC_ACCOUNT_NAME
4949
import com.owncloud.android.testutil.OC_AUTH_TOKEN_TYPE
50+
import com.owncloud.android.testutil.OC_BASIC_PASSWORD
5051
import com.owncloud.android.testutil.OC_SECURE_BASE_URL
5152
import com.owncloud.android.testutil.OC_BASIC_USERNAME
5253
import com.owncloud.android.testutil.OC_OAUTH_SUPPORTED_TRUE
@@ -91,7 +92,7 @@ class OCLocalAuthenticationDataSourceTest {
9192
val newAccountName = ocLocalAuthenticationDataSource.addBasicAccount(
9293
OC_ACCOUNT_ID,
9394
OC_REDIRECTION_PATH.lastPermanentLocation,
94-
"password",
95+
OC_BASIC_PASSWORD,
9596
OC_SECURE_SERVER_INFO_BASIC_AUTH,
9697
OC_USER_INFO,
9798
null
@@ -103,7 +104,7 @@ class OCLocalAuthenticationDataSourceTest {
103104

104105
// One for checking if the account exists and another one for getting the new account
105106
verifyAccountsByTypeAreGot(newAccount.type, 2)
106-
verifyAccountIsExplicitlyAdded(newAccount, "password", 1)
107+
verifyAccountIsExplicitlyAdded(newAccount, OC_BASIC_PASSWORD, 1)
107108
verifyAccountInfoIsUpdated(newAccount, OC_SECURE_SERVER_INFO_BASIC_AUTH, OC_USER_INFO, 1)
108109
}
109110

@@ -113,7 +114,7 @@ class OCLocalAuthenticationDataSourceTest {
113114
ocLocalAuthenticationDataSource.addBasicAccount(
114115
OC_ACCOUNT_ID,
115116
OC_REDIRECTION_PATH.lastPermanentLocation,
116-
"password",
117+
OC_BASIC_PASSWORD,
117118
OC_SECURE_SERVER_INFO_BASIC_AUTH,
118119
OC_USER_INFO.copy(id = OC_ACCOUNT_ID),
119120
null
@@ -128,7 +129,7 @@ class OCLocalAuthenticationDataSourceTest {
128129
val accountName = ocLocalAuthenticationDataSource.addBasicAccount(
129130
OC_ACCOUNT_ID,
130131
OC_REDIRECTION_PATH.lastPermanentLocation,
131-
"password",
132+
OC_BASIC_PASSWORD,
132133
OC_SECURE_SERVER_INFO_BASIC_AUTH,
133134
OC_USER_INFO.copy(id = OC_ACCOUNT_ID),
134135
OC_ACCOUNT_NAME
@@ -140,7 +141,7 @@ class OCLocalAuthenticationDataSourceTest {
140141
verifyAccountsByTypeAreGot(OC_ACCOUNT.type, 1)
141142

142143
// The account already exists so do not create it
143-
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, "password", 0)
144+
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, OC_BASIC_PASSWORD, 0)
144145

145146
// The account already exists, so update it
146147
verifyAccountInfoIsUpdated(OC_ACCOUNT, OC_SECURE_SERVER_INFO_BASIC_AUTH, OC_USER_INFO, 1)
@@ -155,7 +156,7 @@ class OCLocalAuthenticationDataSourceTest {
155156
ocLocalAuthenticationDataSource.addBasicAccount(
156157
OC_BASIC_USERNAME,
157158
OC_REDIRECTION_PATH.lastPermanentLocation,
158-
"password",
159+
OC_BASIC_PASSWORD,
159160
OC_SECURE_SERVER_INFO_BASIC_AUTH,
160161
OC_USER_INFO,
161162
"NotTheSameAccount"
@@ -164,7 +165,7 @@ class OCLocalAuthenticationDataSourceTest {
164165
assertTrue(exception is AccountNotTheSameException)
165166
} finally {
166167
// The account already exists so do not create a new one
167-
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, "password", 0)
168+
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, OC_BASIC_PASSWORD, 0)
168169

169170
// The account is not the same, so no update needed
170171
verifyAccountInfoIsUpdated(OC_ACCOUNT, OC_SECURE_SERVER_INFO_BASIC_AUTH, OC_USER_INFO, 0)
@@ -244,7 +245,7 @@ class OCLocalAuthenticationDataSourceTest {
244245
verifyAccountsByTypeAreGot(OC_ACCOUNT.type, 1)
245246

246247
// The account already exists so do not create it
247-
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, "password", 0)
248+
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, OC_BASIC_PASSWORD, 0)
248249

249250
// The account already exists, so update it
250251
verifyAccountInfoIsUpdated(OC_ACCOUNT, OC_SECURE_SERVER_INFO_BASIC_AUTH, OC_USER_INFO, 1)
@@ -273,7 +274,7 @@ class OCLocalAuthenticationDataSourceTest {
273274
assertTrue(exception is AccountNotTheSameException)
274275
} finally {
275276
// The account already exists so do not create it
276-
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, "password", 0)
277+
verifyAccountIsExplicitlyAdded(OC_ACCOUNT, OC_BASIC_PASSWORD, 0)
277278

278279
// The account already exists, so update it
279280
verifyAccountInfoIsUpdated(OC_ACCOUNT, OC_SECURE_SERVER_INFO_BASIC_AUTH, OC_USER_INFO, 0)

owncloudData/src/test/java/com/owncloud/android/data/appregistry/datasources/implementation/OCLocalAppRegistryDataSourceTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,19 @@ class OCLocalAppRegistryDataSourceTest {
106106

107107
@Test
108108
fun `saveAppRegistryForAccount saves an AppRegistry correctly`() {
109-
109+
val appRegistryOtherName = "appRegistryMimeTypes.name2"
110110
val appRegistry = AppRegistry(
111111
OC_ACCOUNT_NAME, mutableListOf(
112112
OC_APP_REGISTRY_MIMETYPE,
113-
OC_APP_REGISTRY_MIMETYPE.copy(name = "appRegistryMimeTypes.name2")
113+
OC_APP_REGISTRY_MIMETYPE.copy(name = appRegistryOtherName)
114114
)
115115
)
116116

117117
ocLocalAppRegistryDataSource.saveAppRegistryForAccount(appRegistry)
118118

119119
verify(exactly = 1) {
120120
appRegistryDao.deleteAppRegistryForAccount(appRegistry.accountName)
121-
appRegistryDao.upsertAppRegistries(listOf(OC_APP_REGISTRY_ENTITY, OC_APP_REGISTRY_ENTITY.copy(name = "appRegistryMimeTypes.name2")))
121+
appRegistryDao.upsertAppRegistries(listOf(OC_APP_REGISTRY_ENTITY, OC_APP_REGISTRY_ENTITY.copy(name = appRegistryOtherName)))
122122
}
123123
}
124124

0 commit comments

Comments
 (0)