@Test public void onUsersFetched_emptyUnitList(){ FetchUsersEvent mockEmptyListEvent = mock(FetchUsersEvent.class); ImmutableSet<User> userSet = ImmutableSet.of(); when(mockEmptyListEvent.getUsers()).thenReturn(userSet); userListController.onUsersFetched(mockEmptyListEvent); verify(mockView).setUsers(setUsersArgument.capture()); assertTrue(setUsersArgument.getValue().isEmpty()); }
@Override public void onUsersFetched(FetchUsersEvent event) { users = new ArrayList<>(event.getUsers()); sortUsers(User.Properties.lastName, true); }
UserListController extends Controller<UserListView> implements FetchUsersEvent.Handler { @Override public void onUsersFetched(FetchUsersEvent event) { users = new ArrayList<>(event.getUsers()); sortUsers(User.Properties.lastName, true); } }
UserListController extends Controller<UserListView> implements FetchUsersEvent.Handler { @Override public void onUsersFetched(FetchUsersEvent event) { users = new ArrayList<>(event.getUsers()); sortUsers(User.Properties.lastName, true); } UserListController(UserListView view); }
UserListController extends Controller<UserListView> implements FetchUsersEvent.Handler { @Override public void onUsersFetched(FetchUsersEvent event) { users = new ArrayList<>(event.getUsers()); sortUsers(User.Properties.lastName, true); } UserListController(UserListView view); void sortUsers(User.Properties property, boolean ascending); void deleteUser(User user); void editUser(User user); @Override void onUsersFetched(FetchUsersEvent event); void updateUsers(); @Override void onStop(); }
UserListController extends Controller<UserListView> implements FetchUsersEvent.Handler { @Override public void onUsersFetched(FetchUsersEvent event) { users = new ArrayList<>(event.getUsers()); sortUsers(User.Properties.lastName, true); } UserListController(UserListView view); void sortUsers(User.Properties property, boolean ascending); void deleteUser(User user); void editUser(User user); @Override void onUsersFetched(FetchUsersEvent event); void updateUsers(); @Override void onStop();  }