@Test void getUser() { String username = "username"; User existingUser = mock(User.class); when(dataService.findOne( USER, new QueryImpl<User>().eq(UserMetadata.USERNAME, username), User.class)) .thenReturn(existingUser); assertEquals(existingUser, molgenisUserServiceImpl.getUser(username)); }
@Override @RunAsSystem public @Nullable @CheckForNull User getUser(String username) { return dataService.findOne( USER, new QueryImpl<User>().eq(UserMetadata.USERNAME, username), User.class); }
UserServiceImpl implements UserService { @Override @RunAsSystem public @Nullable @CheckForNull User getUser(String username) { return dataService.findOne( USER, new QueryImpl<User>().eq(UserMetadata.USERNAME, username), User.class); } }
UserServiceImpl implements UserService { @Override @RunAsSystem public @Nullable @CheckForNull User getUser(String username) { return dataService.findOne( USER, new QueryImpl<User>().eq(UserMetadata.USERNAME, username), User.class); } UserServiceImpl(DataService dataService); }
UserServiceImpl implements UserService { @Override @RunAsSystem public @Nullable @CheckForNull User getUser(String username) { return dataService.findOne( USER, new QueryImpl<User>().eq(UserMetadata.USERNAME, username), User.class); } UserServiceImpl(DataService dataService); @Override @RunAsSystem List<User> getUsers(); @Override @RunAsSystem List<String> getSuEmailAddresses(); @Override @RunAsSystem @Nullable @CheckForNull User getUser(String username); @Override @RunAsSystem void update(User user); @Override @RunAsSystem User getUserByEmail(String email); }
UserServiceImpl implements UserService { @Override @RunAsSystem public @Nullable @CheckForNull User getUser(String username) { return dataService.findOne( USER, new QueryImpl<User>().eq(UserMetadata.USERNAME, username), User.class); } UserServiceImpl(DataService dataService); @Override @RunAsSystem List<User> getUsers(); @Override @RunAsSystem List<String> getSuEmailAddresses(); @Override @RunAsSystem @Nullable @CheckForNull User getUser(String username); @Override @RunAsSystem void update(User user); @Override @RunAsSystem User getUserByEmail(String email);  }