How can you unit test your reactive code? What tools do you have available?
- [Manuel] Hi. Welcome to the second and last…video of this section, Unit Testing.…In the previous video we learned how to…use the operators of ObserveOn and SubscribeOn…in order to use subscribers to decide in which…threads we want to do what.…In this video we are going to talk about…unit testing.…How can we unit test everything we have learned…if we are focused on the testing of publishers…and subscribers?…We are going to see the different tools we have…available to make the testing as easy as possible…in RxJava too.…
There are different ways you can unit test…Reactive code.…First thing that might come to your mind…is subscribing to the publisher inside the test.…Get that result and assert it.…Imagine you have a method that returns a user…that is loaded from the database,…as we can see in the first image.…In our case we have that method called…loadUserFromDataBase().…How can we test it?…Take a look at the second image.…We can test it easily if we subscribe to it…and assign the result to a variable.…
The code works because the publisher is running…
AuthorManuel Vicente Vivo
This course was created and produced by Packt Publishing. We are honored to host this training in our library.
- What is reactive programming?
- Java 9 reactive features
- Creating and observing sources with RxJava
- Unit testing
- Akka streams in a reactive environment
- Building a sample reactive application
Skill Level Intermediate
1. What Is Reactive Programming?
2. Reactivity in Java 9
3. Introducing RxJava 2.0
5. Concurrency and Unit Testing
6. Akka Streams
7. Real-Life Reactive Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.