@@ -46,7 +46,7 @@ class LoginUserOperationExecutorTests : FunSpec({
46
46
test("login anonymous user successfully creates user") {
47
47
/* Given */
48
48
val mockUserBackendService = mockk<IUserBackendService >()
49
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
49
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
50
50
CreateUserResponse (
51
51
mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId),
52
52
PropertiesObject (),
@@ -80,15 +80,14 @@ class LoginUserOperationExecutorTests : FunSpec({
80
80
appId,
81
81
mapOf(),
82
82
any(),
83
- any(),
84
83
)
85
84
}
86
85
}
87
86
88
87
test("login anonymous user fails with retry when network condition exists") {
89
88
/* Given */
90
89
val mockUserBackendService = mockk<IUserBackendService >()
91
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } throws BackendException (408, "TIMEOUT ")
90
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } throws BackendException (408, "TIMEOUT ")
92
91
93
92
val mockIdentityOperationExecutor = mockk<IdentityOperationExecutor >()
94
93
@@ -104,13 +103,13 @@ class LoginUserOperationExecutorTests : FunSpec({
104
103
105
104
/* Then */
106
105
response.result shouldBe ExecutionResult .FAIL_RETRY
107
- coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(), any(), any() ) }
106
+ coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(), any()) }
108
107
}
109
108
110
109
test("login anonymous user fails with no retry when backend error condition exists") {
111
110
/* Given */
112
111
val mockUserBackendService = mockk<IUserBackendService >()
113
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } throws BackendException (404, "NOT FOUND ")
112
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } throws BackendException (404, "NOT FOUND ")
114
113
115
114
val mockIdentityOperationExecutor = mockk<IdentityOperationExecutor >()
116
115
@@ -126,13 +125,13 @@ class LoginUserOperationExecutorTests : FunSpec({
126
125
127
126
/* Then */
128
127
response.result shouldBe ExecutionResult .FAIL_NORETRY
129
- coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(), any(), any() ) }
128
+ coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(), any()) }
130
129
}
131
130
132
131
test("login identified user without association successfully creates user") {
133
132
/* Given */
134
133
val mockUserBackendService = mockk<IUserBackendService >()
135
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
134
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
136
135
CreateUserResponse (mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId), PropertiesObject (), listOf())
137
136
138
137
val mockIdentityOperationExecutor = mockk<IdentityOperationExecutor >()
@@ -149,7 +148,7 @@ class LoginUserOperationExecutorTests : FunSpec({
149
148
150
149
/* Then */
151
150
response.result shouldBe ExecutionResult .SUCCESS
152
- coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(IdentityConstants .EXTERNAL_ID to "externalId"), any(), any() ) }
151
+ coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(IdentityConstants .EXTERNAL_ID to "externalId"), any()) }
153
152
}
154
153
155
154
test("login identified user with association succeeds when association is successful") {
@@ -188,7 +187,7 @@ class LoginUserOperationExecutorTests : FunSpec({
188
187
test("login identified user with association fails with retry when association fails with retry") {
189
188
/* Given */
190
189
val mockUserBackendService = mockk<IUserBackendService >()
191
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
190
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
192
191
CreateUserResponse (mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId), PropertiesObject (), listOf())
193
192
194
193
val mockIdentityOperationExecutor = mockk<IdentityOperationExecutor >()
@@ -223,7 +222,7 @@ class LoginUserOperationExecutorTests : FunSpec({
223
222
test("login identified user with association successfully creates user when association fails with no retry") {
224
223
/* Given */
225
224
val mockUserBackendService = mockk<IUserBackendService >()
226
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
225
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
227
226
CreateUserResponse (mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId), PropertiesObject (), listOf())
228
227
229
228
val mockIdentityOperationExecutor = mockk<IdentityOperationExecutor >()
@@ -253,13 +252,13 @@ class LoginUserOperationExecutorTests : FunSpec({
253
252
},
254
253
)
255
254
}
256
- coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(IdentityConstants .EXTERNAL_ID to "externalId"), any(), any() ) }
255
+ coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(IdentityConstants .EXTERNAL_ID to "externalId"), any()) }
257
256
}
258
257
259
258
test("login identified user with association fails with retry when association fails with no retry and network condition exists") {
260
259
/* Given */
261
260
val mockUserBackendService = mockk<IUserBackendService >()
262
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } throws BackendException (408, "TIMEOUT ")
261
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } throws BackendException (408, "TIMEOUT ")
263
262
264
263
val mockIdentityOperationExecutor = mockk<IdentityOperationExecutor >()
265
264
coEvery { mockIdentityOperationExecutor.execute(any()) } returns ExecutionResponse (ExecutionResult .FAIL_NORETRY )
@@ -288,13 +287,13 @@ class LoginUserOperationExecutorTests : FunSpec({
288
287
},
289
288
)
290
289
}
291
- coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(IdentityConstants .EXTERNAL_ID to "externalId"), any(), any() ) }
290
+ coVerify(exactly = 1) { mockUserBackendService.createUser(appId, mapOf(IdentityConstants .EXTERNAL_ID to "externalId"), any()) }
292
291
}
293
292
294
293
test("creating user will merge operations into one backend call") {
295
294
/* Given */
296
295
val mockUserBackendService = mockk<IUserBackendService >()
297
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
296
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
298
297
CreateUserResponse (
299
298
mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId),
300
299
PropertiesObject (),
@@ -351,14 +350,6 @@ class LoginUserOperationExecutorTests : FunSpec({
351
350
mockUserBackendService.createUser(
352
351
appId,
353
352
mapOf("aliasLabel1" to "aliasValue1-2"),
354
- withArg {
355
- it.country shouldBe "country"
356
- it.language shouldBe "lang2"
357
- it.timezoneId shouldBe "timezone"
358
- it.latitude shouldBe 123.45
359
- it.longitude shouldBe 678.90
360
- it.tags shouldBe mapOf("tagKey1" to "tagValue1-2")
361
- },
362
353
withArg {
363
354
it.count() shouldBe 1
364
355
it[0].type shouldBe SubscriptionObjectType .ANDROID_PUSH
@@ -373,7 +364,7 @@ class LoginUserOperationExecutorTests : FunSpec({
373
364
test("creating user will hydrate when the user hasn't changed") {
374
365
/* Given */
375
366
val mockUserBackendService = mockk<IUserBackendService >()
376
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
367
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
377
368
CreateUserResponse (
378
369
mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId),
379
370
PropertiesObject (),
@@ -432,15 +423,14 @@ class LoginUserOperationExecutorTests : FunSpec({
432
423
appId,
433
424
mapOf(),
434
425
any(),
435
- any(),
436
426
)
437
427
}
438
428
}
439
429
440
430
test("creating user will not hydrate when the user has changed") {
441
431
/* Given */
442
432
val mockUserBackendService = mockk<IUserBackendService >()
443
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
433
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
444
434
CreateUserResponse (
445
435
mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId),
446
436
PropertiesObject (),
@@ -499,15 +489,14 @@ class LoginUserOperationExecutorTests : FunSpec({
499
489
appId,
500
490
mapOf(),
501
491
any(),
502
- any(),
503
492
)
504
493
}
505
494
}
506
495
507
496
test("creating user will provide local to remote translations") {
508
497
/* Given */
509
498
val mockUserBackendService = mockk<IUserBackendService >()
510
- coEvery { mockUserBackendService.createUser(any(), any(), any(), any() ) } returns
499
+ coEvery { mockUserBackendService.createUser(any(), any(), any()) } returns
511
500
CreateUserResponse (
512
501
mapOf(IdentityConstants .ONESIGNAL_ID to remoteOneSignalId),
513
502
PropertiesObject (),
@@ -547,7 +536,6 @@ class LoginUserOperationExecutorTests : FunSpec({
547
536
appId,
548
537
mapOf(),
549
538
any(),
550
- any(),
551
539
)
552
540
}
553
541
}
0 commit comments