Laur's blog
  • Home
  • About
  • Support my work
Sign in Subscribe

rx

A collection of 1 post
Mock an Observable Interface
interface

Mock an Observable Interface

TL;DR: Use a doAnswer() with a new Answer<Observable<Type>>() if you have to mock observables. Today I wrote my first test where I had to mock an observable interface: public interface UserDatabase { Observable<User> readUser(String username); } where the User model is:
Aug 1, 2016 1 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost