Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Unit Testing / Understanding Rx Java
Search
Trevor John
November 10, 2015
Programming
200
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Unit Testing / Understanding Rx Java
Talk on understanding RxJava interfaces given at the NY Android meetup on 11/10/2015
Trevor John
November 10, 2015
Other Decks in Programming
See All in Programming
速習iPhone Duo対応
yuukiw00w
2
960
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
130
Jetpack Compose Mechanisms
skydoves
2
510
Verilogで学ぶCPU自作入門.pdf
uyuki234
8
4k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
190
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
340
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
540
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Rでドレミ/Do-Re-Mi_with_R
florets1
0
120
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
120
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.5k
Featured
See All Featured
Abbi's Birthday
coloredviolet
4
10k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Un-Boring Meetings
codingconduct
0
440
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
210
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
270
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Discover your Explorer Soul
emna__ayadi
2
1.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Transcript
Unit Testing Rx API’s (Understanding Rx API’s) Trevor John Draft
trevorrjohn @trevorrjohn
What We Will Cover Learn how RxJava APIs work (should
work) How to use what we learned to write simple tests
Quick Overview Rx programming definition: An API for asynchronous programming
with observable streams (http: //reactivex.io/) While the API is simple it is very large Most common use case is fetching data
RxJava Usage Allows you to simply handle responses while ignoring
threading It allows for easier error handling Minimizes race conditions
Understanding How Rx Works Observable
Understanding How Rx Works Observable
Understanding How Rx Works Observable
Understanding How Rx Works Subscription
Understanding How Rx Works With Rx if nobody is listening
it won’t do anything! No subscription, no anything (There are exceptions)
Unit Test It Unit test → Mock it!
WHOA!? Crazy right?! Not flexible Not practical What can we
do? What if we want to use map?
WHOA!? The test doesn’t even work… :(
Observable Creation OnSubscribe interface? Subscriber?
Subscriber! I know those methods! Observable#subscribe() How data is passed
back How does this help us test?
So what now?
Fake OnSubscribe Captures the subscriber Creates interface for notifying the
subscriber
How Do We Use It? That looks good! Not tied
to the implementation!
What is Better? 5* statements Reusable Magic? 11 statements Ridged
Very straightforward
Another Option? Subjects! - They are super powerful and could
be a better/simpler solution for testing. Less configurable, but it works and no “fake” classes
Common Smells Name your tests! @Test public void methodName_context_assertion() Keep
tests short! Limit assertions per test
Questions?