    @Test
    public void getUser() {

        User userEntity = new User("john.doe@gmail.com", "John", "Doe");
        com.jonathanpetitfrere.mvvm.repository.api.model.User userModel = mapper.toModel(userEntity);

        when(transformers.applySchedulersToFlowable()).thenReturn(flowable -> flowable);
        when(userDao.loadUser(anyString())).thenReturn(Flowable.just(userEntity));
        when(userApi.getUser(anyString())).thenReturn(Flowable.just(userModel));

        Observer<User> observer = mock(Observer.class);

        userRepository.getUser(anyString())
                .observeForever(observer);

        verify(userDao, times(1)).loadUser(anyString());
        verify(userApi, times(1)).getUser(anyString());
        verify(userDao, times(1)).saveUser(userEntity);
        verify(observer, only()).onChanged(userEntity);
    }