@Test public void onAccountUpdatedEvent_withUnrelatedUsername_emitsUpdatedProfileContent() throws Exception { final Account account = configureBareMockAccount(); createAndObserveInteractor(); verify(profileObserver).onData(refEq(new UserProfileViewModel( UserProfileViewModel.LimitedProfileMessage.NONE, null, null, new UserProfileBioModel( UserProfileBioModel.ContentType.NO_ABOUT_ME, null))) ); when(account.getUsername()).thenReturn(ProfileValues.ALTERNATE_USERNAME); when(account.getBio()).thenReturn(ProfileValues.ABOUT_ME); eventBus.post(new AccountDataLoadedEvent(account)); verifyNoMoreInteractions(profileObserver); }
@NonNull public String getUsername() { return username; }
UserProfileInteractor implements RefreshListener { @NonNull public String getUsername() { return username; } }
UserProfileInteractor implements RefreshListener { @NonNull public String getUsername() { return username; } UserProfileInteractor(@NonNull final String username, @NonNull final UserService userService, @NonNull EventBus eventBus, @NonNull UserPrefs userPrefs); }
UserProfileInteractor implements RefreshListener { @NonNull public String getUsername() { return username; } UserProfileInteractor(@NonNull final String username, @NonNull final UserService userService, @NonNull EventBus eventBus, @NonNull UserPrefs userPrefs); @NonNull Observable<UserProfileViewModel> observeProfile(); @NonNull Observable<UserProfileImageViewModel> observeProfileImage(); @SuppressWarnings("unused") void onEventMainThread(@NonNull AccountDataLoadedEvent event); @SuppressWarnings("unused") void onEventMainThread(@NonNull ProfilePhotoUpdatedEvent event); @NonNull String getUsername(); boolean isViewingOwnProfile(); void destroy(); @Override void onRefresh(); }
UserProfileInteractor implements RefreshListener { @NonNull public String getUsername() { return username; } UserProfileInteractor(@NonNull final String username, @NonNull final UserService userService, @NonNull EventBus eventBus, @NonNull UserPrefs userPrefs); @NonNull Observable<UserProfileViewModel> observeProfile(); @NonNull Observable<UserProfileImageViewModel> observeProfileImage(); @SuppressWarnings("unused") void onEventMainThread(@NonNull AccountDataLoadedEvent event); @SuppressWarnings("unused") void onEventMainThread(@NonNull ProfilePhotoUpdatedEvent event); @NonNull String getUsername(); boolean isViewingOwnProfile(); void destroy(); @Override void onRefresh();  }