Skip to content

Instantly share code, notes, and snippets.

@lovewithmind
Last active May 5, 2020 19:49
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/68268facd6c07ebb1aaeab376a874414 to your computer and use it in GitHub Desktop.
Save lovewithmind/68268facd6c07ebb1aaeab376a874414 to your computer and use it in GitHub Desktop.
This is an example of reactive test with block
@Test
fun `should return person data given name of the person`(){
val monoPerson = PersonManager.getProfile("PersonX")
val expectedResult = Person(name = "PersonX", age = 18)
assertThat(monoPerson.block()).isEqual(expectedResult)
}
@Test
fun `should return list of person data`(){
val fluxList = PersonManager.getAllProfile()
val expectedResult = listOf(Person(name = "PersonX", age = 18),Person(name = "PersonY", age = 20))
assertThat(fluxList.collectList().block()).isEqual(expectedResult)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment