| 1 | package edu.ucsb.cs156.gauchoride.services; | |
| 2 | ||
| 3 | import org.springframework.beans.factory.annotation.Autowired; | |
| 4 | import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; | |
| 5 | import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; | |
| 6 | import org.springframework.security.oauth2.core.OAuth2AccessToken; | |
| 7 | import org.springframework.stereotype.Service; | |
| 8 | ||
| 9 | import lombok.extern.slf4j.Slf4j; | |
| 10 | ||
| 11 | @Service | |
| 12 | @Slf4j | |
| 13 | public class GoogleTokenService { | |
| 14 | ||
| 15 | @Autowired | |
| 16 | OAuth2AuthorizedClientService oAuth2AuthorizedClientService; | |
| 17 | ||
| 18 | public OAuth2AccessToken getAccessToken(String principalName) { | |
| 19 | log.info("principalName={}", principalName); | |
| 20 | OAuth2AuthorizedClient oAuth2AuthorizedClient = oAuth2AuthorizedClientService.loadAuthorizedClient("google", principalName); | |
| 21 |
1
1. getAccessToken : replaced return value with null for edu/ucsb/cs156/gauchoride/services/GoogleTokenService::getAccessToken → NO_COVERAGE |
return oAuth2AuthorizedClient.getAccessToken(); |
| 22 | } | |
| 23 | ||
| 24 | } | |
Mutations | ||
| 21 |
1.1 |