Skip to content

Instantly share code, notes, and snippets.

@lovewithmind
Last active May 7, 2020 21:05
Show Gist options
  • Save lovewithmind/bbe5278fda280bc7bf25e7c424685f0b to your computer and use it in GitHub Desktop.
Save lovewithmind/bbe5278fda280bc7bf25e7c424685f0b to your computer and use it in GitHub Desktop.
@Test
fun `should throw Exception for mono`(){
val monoError = Mono.error<Exception>(Exception())
StepVerifier.create(mono)
.expectError(Exception::class.java)
.verify()
}
@Test
fun `should consume thrown exception from flux`() {
val concat = Flux.concat(Mono.just("hello"), Mono.error(Exception()))
StepVerifier.create(concat)
.expectNext("hello")
.expectError(Exception::class.java)
.verify()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment