Skip to content

Instantly share code, notes, and snippets.

@lovewithmind
Last active May 7, 2020 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lovewithmind/fc8a54887b8d8065d4a7bb4e348dd573 to your computer and use it in GitHub Desktop.
Save lovewithmind/fc8a54887b8d8065d4a7bb4e348dd573 to your computer and use it in GitHub Desktop.
@Test
fun `should throw exception while fetching person data`(){
val personService = PersonService()
assertThatThrownBy{
personService.getPerson("name")
}.isInstanceOf(PersonNotFound::class.java)
.hasMessage("No person found in the database")
}
@Test
fun `should throw execption for flux of Data`() {
val concat = Flux.concat(Mono.just("hello"), Mono.error(Exception()))
assertThatThrownBy{
concat.collectList().block()
}.isInstanceOf(Exception::class.java)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment