@Test void removeToken() { Token token = mock(Token.class); when(token.getToken()).thenReturn("token"); @SuppressWarnings("unchecked") Query<Token> q = mock(Query.class); when(q.eq(TOKEN_ATTR, "token")).thenReturn(q); when(q.findOne()).thenReturn(token); when(dataService.query(TOKEN, Token.class)).thenReturn(q); tokenService.removeToken("token"); verify(dataService).delete(TOKEN, token); }
@Override @Transactional @RunAsSystem public void removeToken(String token) { Token molgenisToken = getMolgenisToken(token); dataService.delete(TOKEN, molgenisToken); }
DataServiceTokenService implements TokenService { @Override @Transactional @RunAsSystem public void removeToken(String token) { Token molgenisToken = getMolgenisToken(token); dataService.delete(TOKEN, molgenisToken); } }
DataServiceTokenService implements TokenService { @Override @Transactional @RunAsSystem public void removeToken(String token) { Token molgenisToken = getMolgenisToken(token); dataService.delete(TOKEN, molgenisToken); } DataServiceTokenService(
      TokenGenerator tokenGenerator,
      DataService dataService,
      UserDetailsService userDetailsService,
      TokenFactory tokenFactory); }
DataServiceTokenService implements TokenService { @Override @Transactional @RunAsSystem public void removeToken(String token) { Token molgenisToken = getMolgenisToken(token); dataService.delete(TOKEN, molgenisToken); } DataServiceTokenService(
      TokenGenerator tokenGenerator,
      DataService dataService,
      UserDetailsService userDetailsService,
      TokenFactory tokenFactory); @Override @Transactional(readOnly = true) @RunAsSystem UserDetails findUserByToken(String token); @Override @Transactional @RunAsSystem String generateAndStoreToken(String username, String description); @Override @Transactional @RunAsSystem void removeToken(String token); }
DataServiceTokenService implements TokenService { @Override @Transactional @RunAsSystem public void removeToken(String token) { Token molgenisToken = getMolgenisToken(token); dataService.delete(TOKEN, molgenisToken); } DataServiceTokenService(
      TokenGenerator tokenGenerator,
      DataService dataService,
      UserDetailsService userDetailsService,
      TokenFactory tokenFactory); @Override @Transactional(readOnly = true) @RunAsSystem UserDetails findUserByToken(String token); @Override @Transactional @RunAsSystem String generateAndStoreToken(String username, String description); @Override @Transactional @RunAsSystem void removeToken(String token);  }