Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Unit Testing / Understanding Rx Java
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Trevor John
November 10, 2015
Programming
1
180
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
Tweet
Share
Other Decks in Programming
See All in Programming
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
240
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
Grafana:建立系統全知視角的捷徑
blueswen
0
320
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
190
CSC307 Lecture 07
javiergs
PRO
0
550
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
100
Patterns of Patterns
denyspoltorak
0
1.4k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.9k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Side Projects
sachag
455
43k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
76
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Skip the Path - Find Your Career Trail
mkilby
0
52
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
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?