Last active
May 7, 2020 19:44
-
-
Save lovewithmind/fc8a54887b8d8065d4a7bb4e348dd573 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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