UserManager { public long getTotalCount() throws ServerException { return userDao.getTotalCount(); } @Inject  UserManager(
      UserDao userDao,
      ProfileDao profileDao,
      PreferenceDao preferencesDao,
      EventService eventService,
      @Named("che.auth.reserved_user_names") String[] reservedNames); User create(User newUser, boolean isTemporary); void update(User user); User getById(String id); User getByAlias(String alias); User getByName(String name); User getByEmail(String email); Page<UserImpl> getAll(int maxItems, long skipCount); Page<? extends User> getByEmailPart(String emailPart, int maxItems, long skipCount); Page<? extends User> getByNamePart(String namePart, int maxItems, long skipCount); long getTotalCount(); void remove(String id); static final String PERSONAL_ACCOUNT; }
@Test public void shouldGetTotalUserCount() throws Exception { when(userDao.getTotalCount()).thenReturn(5L); assertEquals(manager.getTotalCount(), 5); verify(userDao).getTotalCount(); }