Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test("recovered standalone") {
- val ex = new NoSuchElementException
- // exception in the end
- val o1 = Observable(1, 2, 3) ++ Observable(ex)
- val o1Revocered = o1.recovered
- assert(o1Revocered.toBlockingObservable.toList === List(Success(1), Success(2), Success(3), Failure(ex)))
- // exception in the middle
- val o2 = Observable(1, 2) ++ Observable(ex) ++ Observable(3)
- val o2Revocered = o2.recovered
- assert(o2Revocered.toBlockingObservable.toList === List(Success(1), Success(2), Failure(ex), Success(3)))
- // exception in the end
- val o3 = Observable(1, 2, 3) ++ Observable(ex)
- val o3Revocered = o3.recovered
- assert(o3Revocered.toBlockingObservable.toList === List(Failure(ex), Success(1), Success(2), Success(3)))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement