Skip to content

Commit 4835e3a

Browse files
committed
Fix linting + tests
1 parent e2a0db3 commit 4835e3a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/main/java/com/microsoft/graph/core/requests/GraphClientFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public static OkHttpClient.Builder create(@Nonnull GraphClientOption graphClient
9696
* @param interceptors desired interceptors for use in requests.
9797
* @return an OkHttpClient Builder instance.
9898
*/
99+
@Nonnull
99100
public static OkHttpClient.Builder create(@Nonnull GraphClientOption graphClientOption, @Nonnull List<Interceptor> interceptors) {
100101
return create(graphClientOption, interceptors.toArray(new Interceptor[0]));
101102
}

src/test/java/com/microsoft/graph/core/requests/GraphClientFactoryTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
import org.junit.jupiter.api.Test;
1515

16+
import com.microsoft.graph.core.authentication.AzureIdentityAccessTokenProvider;
17+
import com.microsoft.graph.core.authentication.AzureIdentityAuthenticationProvider;
1618
import com.microsoft.kiota.authentication.AccessTokenProvider;
1719
import com.microsoft.kiota.authentication.AllowedHostsValidator;
1820
import com.microsoft.kiota.authentication.BaseBearerTokenAuthenticationProvider;
@@ -41,14 +43,12 @@ void testCreateWithAuthenticationProvider() throws IOException {
4143
}
4244

4345
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);
4847
when(mockAccessTokenProvider.getAuthorizationToken(any(URI.class), anyMap()))
4948
.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);
5252
when(mockAuthenticationProvider.getAccessTokenProvider())
5353
.thenReturn(mockAccessTokenProvider);
5454
return mockAuthenticationProvider;

0 commit comments

Comments
 (0)