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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
590
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
AIとGame Jamで、ゲームを完成させた話
takahirosaeki
0
120
How I Stole PSI from Android Studio - DroidKaigi2026
worker8
0
110
XHTMLが残したもの
yosuke_furukawa
PRO
2
710
自分的「カンファレンスの楽しみ方」
syumai
0
200
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
610
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
450
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
790
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
220
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
4k
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
450
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
690
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
530
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
ラッコキーワード サービス紹介資料
rakko
1
4.8M
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
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?