@Test public void should_generate_token() { Account account = new Account().setOauthId("anOAUTHID"); tokenService.generateNewToken(account); assertThat(account.getToken()).isNotEmpty(); }
public void generateNewToken(Account account) { Objects.requireNonNull(account); Objects.requireNonNull(account.getOauthId()); account.setToken(UUID.randomUUID().toString()); reinitTokenValidity(account); }
TokenService { public void generateNewToken(Account account) { Objects.requireNonNull(account); Objects.requireNonNull(account.getOauthId()); account.setToken(UUID.randomUUID().toString()); reinitTokenValidity(account); } }
TokenService { public void generateNewToken(Account account) { Objects.requireNonNull(account); Objects.requireNonNull(account.getOauthId()); account.setToken(UUID.randomUUID().toString()); reinitTokenValidity(account); }  }
TokenService { public void generateNewToken(Account account) { Objects.requireNonNull(account); Objects.requireNonNull(account.getOauthId()); account.setToken(UUID.randomUUID().toString()); reinitTokenValidity(account); }  void generateNewToken(Account account); void reinitTokenValidity(Account account); Account checkToken(String token); Account getCredentialsForToken(String token); Member tryToLinkWithActualMember(Account account); }
TokenService { public void generateNewToken(Account account) { Objects.requireNonNull(account); Objects.requireNonNull(account.getOauthId()); account.setToken(UUID.randomUUID().toString()); reinitTokenValidity(account); }  void generateNewToken(Account account); void reinitTokenValidity(Account account); Account checkToken(String token); Account getCredentialsForToken(String token); Member tryToLinkWithActualMember(Account account);  }