@Test public void doFindAccountByAuthToken() { when(repo.findByAuthtoken(ServiceTestConfiguration.AUTH_TOKEN)).thenReturn(ServiceTestConfiguration.user()); assertEquals(service.findAccountprofileByAuthtoken(ServiceTestConfiguration.AUTH_TOKEN).toString(),ServiceTestConfiguration.user().toString()); }
@Cacheable(value = "authorizationCache") public User findAccountprofileByAuthtoken(String token) { logger.debug("UserService.findAccountprofileByAuthtoken looking for authToken: " + token); if (token == null) { logger.error("UserService.findAccountprofileByAuthtoken(): token is null"); throw new AuthenticationException("Authorization Token is null"); } User accountProfile = null; accountProfile = user.findByAuthtoken(token); if (accountProfile == null) { logger.error("UserService.findAccountprofileByAuthtoken(): accountProfile is null for token=" + token); throw new AuthenticationException("Authorization Token not found"); } return accountProfile; }
UserService { @Cacheable(value = "authorizationCache") public User findAccountprofileByAuthtoken(String token) { logger.debug("UserService.findAccountprofileByAuthtoken looking for authToken: " + token); if (token == null) { logger.error("UserService.findAccountprofileByAuthtoken(): token is null"); throw new AuthenticationException("Authorization Token is null"); } User accountProfile = null; accountProfile = user.findByAuthtoken(token); if (accountProfile == null) { logger.error("UserService.findAccountprofileByAuthtoken(): accountProfile is null for token=" + token); throw new AuthenticationException("Authorization Token not found"); } return accountProfile; } }
UserService { @Cacheable(value = "authorizationCache") public User findAccountprofileByAuthtoken(String token) { logger.debug("UserService.findAccountprofileByAuthtoken looking for authToken: " + token); if (token == null) { logger.error("UserService.findAccountprofileByAuthtoken(): token is null"); throw new AuthenticationException("Authorization Token is null"); } User accountProfile = null; accountProfile = user.findByAuthtoken(token); if (accountProfile == null) { logger.error("UserService.findAccountprofileByAuthtoken(): accountProfile is null for token=" + token); throw new AuthenticationException("Authorization Token not found"); } return accountProfile; }  }
UserService { @Cacheable(value = "authorizationCache") public User findAccountprofileByAuthtoken(String token) { logger.debug("UserService.findAccountprofileByAuthtoken looking for authToken: " + token); if (token == null) { logger.error("UserService.findAccountprofileByAuthtoken(): token is null"); throw new AuthenticationException("Authorization Token is null"); } User accountProfile = null; accountProfile = user.findByAuthtoken(token); if (accountProfile == null) { logger.error("UserService.findAccountprofileByAuthtoken(): accountProfile is null for token=" + token); throw new AuthenticationException("Authorization Token not found"); } return accountProfile; }  User findUser(Integer id); User findUser(String username); @Cacheable(value = "authorizationCache") User findAccountprofileByAuthtoken(String token); Integer saveUser(User userRequest); Map<String, Object> login(String username, String password); User logout(String userId); }
UserService { @Cacheable(value = "authorizationCache") public User findAccountprofileByAuthtoken(String token) { logger.debug("UserService.findAccountprofileByAuthtoken looking for authToken: " + token); if (token == null) { logger.error("UserService.findAccountprofileByAuthtoken(): token is null"); throw new AuthenticationException("Authorization Token is null"); } User accountProfile = null; accountProfile = user.findByAuthtoken(token); if (accountProfile == null) { logger.error("UserService.findAccountprofileByAuthtoken(): accountProfile is null for token=" + token); throw new AuthenticationException("Authorization Token not found"); } return accountProfile; }  User findUser(Integer id); User findUser(String username); @Cacheable(value = "authorizationCache") User findAccountprofileByAuthtoken(String token); Integer saveUser(User userRequest); Map<String, Object> login(String username, String password); User logout(String userId);  }