@@ -5,7 +5,7 @@ import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger, AtomicLong, At
5
5
6
6
import org .mockito .{ArgumentMatchersSugar , IdiomaticMockito }
7
7
import org .reactivestreams .Subscription
8
- import org .scalatest .freespec .{ AnyFreeSpec , AsyncFreeSpec }
8
+ import org .scalatest .freespec .AnyFreeSpec
9
9
import org .scalatest .matchers .should .Matchers
10
10
import reactor .core .Disposable
11
11
import reactor .core .publisher .{BaseSubscriber , Signal , SynchronousSink , Mono => JMono }
@@ -99,7 +99,7 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
99
99
100
100
" a future should result Mono that will return the value from the future object" in {
101
101
import scala .concurrent .ExecutionContext .Implicits .global
102
- StepVerifier .create(SMono .fromFuture(Future [ Long ] {
102
+ StepVerifier .create(SMono .fromFuture(Future {
103
103
randomValue
104
104
}))
105
105
.expectNext(randomValue)
@@ -183,13 +183,13 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
183
183
.verifyComplete()
184
184
}
185
185
" emit true when both publisher emit the same value according to the isEqual function" in {
186
- val mono = SMono .sequenceEqual[ Int ] (just(10 ), just(100 ), (t1 : Int , t2 : Int ) => t1 % 10 == t2 % 10 )
186
+ val mono = SMono .sequenceEqual(just(10 ), just(100 ), (t1 : Int , t2 : Int ) => t1 % 10 == t2 % 10 )
187
187
StepVerifier .create(mono)
188
188
.expectNext(true )
189
189
.verifyComplete()
190
190
}
191
191
" emit true when both publisher emit the same value according to the isEqual function with bufferSize" in {
192
- val mono = SMono .sequenceEqual[ Int ] (just(10 ), just(100 ), (t1 : Int , t2 : Int ) => t1 % 10 == t2 % 10 , 2 )
192
+ val mono = SMono .sequenceEqual(just(10 ), just(100 ), (t1 : Int , t2 : Int ) => t1 % 10 == t2 % 10 , 2 )
193
193
StepVerifier .create(mono)
194
194
.expectNext(true )
195
195
.verifyComplete()
@@ -208,11 +208,13 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
208
208
" of publisher of unit should return when all of the sources has fulfilled" in {
209
209
val completed = new ConcurrentHashMap [String , Boolean ]()
210
210
val mono = SMono .when(Iterable (
211
- just[ Unit ] ({
211
+ just({
212
212
completed.put(" first" , true )
213
+ ()
213
214
}),
214
- just[ Unit ] ({
215
+ just({
215
216
completed.put(" second" , true )
217
+ ()
216
218
})
217
219
))
218
220
StepVerifier .create(mono)
@@ -224,11 +226,13 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
224
226
225
227
" with varargs of publisher should return when all of the resources has fulfilled" in {
226
228
val completed = new ConcurrentHashMap [String , Boolean ]()
227
- val sources = Seq (just[ Unit ] ({
229
+ val sources = Seq (just({
228
230
completed.put(" first" , true )
231
+ ()
229
232
}),
230
233
just[Unit ]({
231
234
completed.put(" second" , true )
235
+ ()
232
236
})
233
237
)
234
238
StepVerifier .create(SMono .when(sources.toArray: _* ))
@@ -258,7 +262,7 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
258
262
}
259
263
260
264
" with p1, p2, p3, p4 and p5 should merge when all Monos are fulfilled" in {
261
- StepVerifier .create(SMono .zipDelayError(just[ Int ] (1 ), just(2 ), just(3 ), just(4 ), just(5 )))
265
+ StepVerifier .create(SMono .zipDelayError(just(1 ), just(2 ), just(3 ), just(4 ), just(5 )))
262
266
.expectNext((1 , 2 , 3 , 4 , 5 ))
263
267
.verifyComplete()
264
268
}
@@ -273,10 +277,10 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
273
277
" of publisher of unit should return when all of the sources has fulfilled" in {
274
278
val completed = new ConcurrentHashMap [String , Boolean ]()
275
279
val mono = SMono .whenDelayError(Iterable (
276
- just[ Unit ] ({
280
+ just({
277
281
completed.put(" first" , true )
278
282
}),
279
- just[ Unit ] ({
283
+ just({
280
284
completed.put(" second" , true )
281
285
})
282
286
))
@@ -414,13 +418,13 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
414
418
jMono.cancelOn(any[Scheduler ]) was called
415
419
}
416
420
417
- " .compose should defer creating the target mono type" in {
421
+ " .compose (deprecated) should defer creating the target mono type" in {
418
422
StepVerifier .create(just(1 ).compose[String ](m => SFlux .fromPublisher(m.map(_.toString))))
419
423
.expectNext(" 1" )
420
424
.verifyComplete()
421
425
}
422
426
" .transformDeferred should defer creating the target mono type" in {
423
- StepVerifier .create(SMono .just(1 ).transformDeferred[ String ] (m => SFlux .fromPublisher(m.map(_.toString))))
427
+ StepVerifier .create(SMono .just(1 ).transformDeferred(m => SFlux .fromPublisher(m.map(_.toString))))
424
428
.expectNext(" 1" )
425
429
.verifyComplete()
426
430
}
@@ -440,7 +444,7 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
440
444
}
441
445
442
446
" .defaultIfEmpty should use the provided default value if the mono is empty" in {
443
- StepVerifier .create(SMono .empty[ Int ] .defaultIfEmpty(- 1 ))
447
+ StepVerifier .create(SMono .empty.defaultIfEmpty(- 1 ))
444
448
.expectNext(- 1 )
445
449
.verifyComplete()
446
450
}
@@ -495,7 +499,7 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
495
499
.verifyComplete()
496
500
}
497
501
498
- " .doAfterSuccessOrError should call the callback function after the mono is terminated" in {
502
+ " .doAfterSuccessOrError (deprecated) should call the callback function after the mono is terminated" in {
499
503
val atomicBoolean = new AtomicBoolean (false )
500
504
StepVerifier .create(just(randomValue)
501
505
.doAfterSuccessOrError { t =>
0 commit comments