Tapglue { public User loginWithEmail(String email, String password) throws IOException { return new RxWrapper<User>().unwrap(rxTapglue.loginWithEmail(email, password)); } Tapglue(Configuration configuration, Context context); User loginWithUsername(String username, String password); User loginWithEmail(String email, String password); void logout(); User getCurrentUser(); User createUser(User user); void deleteCurrentUser(); User updateCurrentUser(User updatedUser); User refreshCurrentUser(); User retrieveUser(String id); Connection createConnection(Connection connection); List<User> createSocialConnections(SocialConnections connections); void deleteConnection(String userId, Type type); Post createPost(Post post); Post retrievePost(String postId); Post updatePost(String id, Post post); void deletePost(String postId); Like createLike(String postId); void deleteLike(String postId); Comment createComment(String postId, Comment comment); void deleteComment(String postId, String commentId); Comment updateComment(String postId, String commentId, Comment comment); List<Event> retrieveEventFeed();  }
@Test public void emailLogin() throws Throwable { when(rxTapglue.loginWithEmail(EMAIL, PASSWORD)).thenReturn(Observable.just(user)); assertThat(tapglue.loginWithEmail(EMAIL, PASSWORD), equalTo(user)); }