|
13 | 13 |
|
14 | 14 | import org.junit.jupiter.api.Test; |
15 | 15 |
|
| 16 | +import com.microsoft.graph.core.authentication.AzureIdentityAccessTokenProvider; |
| 17 | +import com.microsoft.graph.core.authentication.AzureIdentityAuthenticationProvider; |
16 | 18 | import com.microsoft.kiota.authentication.AccessTokenProvider; |
17 | 19 | import com.microsoft.kiota.authentication.AllowedHostsValidator; |
18 | 20 | import com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider; |
@@ -41,14 +43,12 @@ void testCreateWithAuthenticationProvider() throws IOException { |
41 | 43 | } |
42 | 44 |
|
43 | 45 | private static BaseBearerTokenAuthenticationProvider getMockAuthenticationProvider() { |
44 | | - final AccessTokenProvider mockAccessTokenProvider = mock(AccessTokenProvider.class); |
45 | | - final AllowedHostsValidator allowedHostsValidator = |
46 | | - new AllowedHostsValidator("graph.microsoft.com"); |
47 | | - when(mockAccessTokenProvider.getAllowedHostsValidator()).thenReturn(allowedHostsValidator); |
| 46 | + final AccessTokenProvider mockAccessTokenProvider = mock(AzureIdentityAccessTokenProvider.class); |
48 | 47 | when(mockAccessTokenProvider.getAuthorizationToken(any(URI.class), anyMap())) |
49 | 48 | .thenReturn(ACCESS_TOKEN_STRING); |
50 | | - final BaseBearerTokenAuthenticationProvider mockAuthenticationProvider = |
51 | | - mock(BaseBearerTokenAuthenticationProvider.class); |
| 49 | + when(mockAccessTokenProvider.getAllowedHostsValidator()).thenReturn(new AllowedHostsValidator("graph.microsoft.com")); |
| 50 | + final AzureIdentityAuthenticationProvider mockAuthenticationProvider = |
| 51 | + mock(AzureIdentityAuthenticationProvider.class); |
52 | 52 | when(mockAuthenticationProvider.getAccessTokenProvider()) |
53 | 53 | .thenReturn(mockAccessTokenProvider); |
54 | 54 | return mockAuthenticationProvider; |
|
0 commit comments