Please enable JavaScript.
Coggle requires JavaScript to display documents.
Test Doubles (Advanced Mockito (General (When it comes to testing we care…
Test Doubles
Advanced Mockito
General
-
Stock example
Let's say we had an app for stocks. If we had a method that requires a Portfolio (we'd need a database to retreive stored information) and StockRetreiver (We'd need the Internet to connect to)
-
Limitations
Can't mock:
-
tatic methods, private methods
final classes, final methods
hashCode(), equals() methods
-
-
Stubbing
Mockito offers when and thenReturn to allow us to return a given value when a specific method is called
-
-
Intro
Imagine we're making a checking application. We don't want to check real transactions in order to test our app. Hence we use doubles
-
-