@Test void getUserTokenDetails() { TokenDetails userTokenDetails = new TokenDetails("accessToken5", "refreshToken555", LocalDateTime.now()); when(usersTokenService.retrieveUsersTokenDetails()).thenReturn(userTokenDetails); assertEquals(service.getTokenDetails(), userTokenDetails); }
public TokenDetails getTokenDetails() { TokenDetails tokenDetails = usersTokenService.retrieveUsersTokenDetails(); if (tokenDetails.isNotEmpty()) { logger.debug("return user's token details: {}", tokenDetails); return tokenDetails; } tokenDetails = applicationTokenService.getApplicationTokenDetails(); if (tokenDetails.isEmpty()) { logger.warn("return empty token details"); } return tokenDetails; }
TokenService { public TokenDetails getTokenDetails() { TokenDetails tokenDetails = usersTokenService.retrieveUsersTokenDetails(); if (tokenDetails.isNotEmpty()) { logger.debug("return user's token details: {}", tokenDetails); return tokenDetails; } tokenDetails = applicationTokenService.getApplicationTokenDetails(); if (tokenDetails.isEmpty()) { logger.warn("return empty token details"); } return tokenDetails; } }
TokenService { public TokenDetails getTokenDetails() { TokenDetails tokenDetails = usersTokenService.retrieveUsersTokenDetails(); if (tokenDetails.isNotEmpty()) { logger.debug("return user's token details: {}", tokenDetails); return tokenDetails; } tokenDetails = applicationTokenService.getApplicationTokenDetails(); if (tokenDetails.isEmpty()) { logger.warn("return empty token details"); } return tokenDetails; } @Autowired  TokenService(UsersTokenService usersTokenService,
                        ApplicationTokenService applicationTokenService,
                        OAuthClient oAuthClient); }
TokenService { public TokenDetails getTokenDetails() { TokenDetails tokenDetails = usersTokenService.retrieveUsersTokenDetails(); if (tokenDetails.isNotEmpty()) { logger.debug("return user's token details: {}", tokenDetails); return tokenDetails; } tokenDetails = applicationTokenService.getApplicationTokenDetails(); if (tokenDetails.isEmpty()) { logger.warn("return empty token details"); } return tokenDetails; } @Autowired  TokenService(UsersTokenService usersTokenService,
                        ApplicationTokenService applicationTokenService,
                        OAuthClient oAuthClient); TokenDetails getTokenDetails(); TokenDetails getTokenByRefreshToken(String refreshToken); }
TokenService { public TokenDetails getTokenDetails() { TokenDetails tokenDetails = usersTokenService.retrieveUsersTokenDetails(); if (tokenDetails.isNotEmpty()) { logger.debug("return user's token details: {}", tokenDetails); return tokenDetails; } tokenDetails = applicationTokenService.getApplicationTokenDetails(); if (tokenDetails.isEmpty()) { logger.warn("return empty token details"); } return tokenDetails; } @Autowired  TokenService(UsersTokenService usersTokenService,
                        ApplicationTokenService applicationTokenService,
                        OAuthClient oAuthClient); TokenDetails getTokenDetails(); TokenDetails getTokenByRefreshToken(String refreshToken);  }