Skip to content

Commit 100390d

Browse files
authored
Apply suggestions from code review
1 parent 63088d1 commit 100390d

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎samples/deviceCodeSample/src/main/java/deviceCodeFlowMain.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class deviceCodeFlowMain {
2222
public static void main(String[] args) throws Exception {
2323
final DeviceCodeCredential deviceCodeCred = new DeviceCodeCredentialBuilder()
2424
.clientId(CLIENT_ID)
25-
.challengeConsumer(challenge -> {System.out.println(challenge.getMessage());})
25+
.challengeConsumer(challenge -> System.out.println(challenge.getMessage()))
2626
.build();
2727

2828
final TokenCredentialAuthProvider tokenCredAuthProvider = new TokenCredentialAuthProvider(SCOPES, deviceCodeCred);

‎src/main/java/com/microsoft/graph/authentication/BaseAuthenticationProvider.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public abstract class BaseAuthenticationProvider implements IAuthenticationProvi
1919
* @return whether a token should be attached to this request
2020
*/
2121
protected boolean shouldAuthenticateRequestWithUrl(@Nonnull final URL requestUrl) {
22-
if(requestUrl == null || !requestUrl.getProtocol().toLowerCase(Locale.ROOT).equals("https"))
22+
if (requestUrl == null || !requestUrl.getProtocol().toLowerCase(Locale.ROOT).equals("https"))
2323
return false;
2424
final String hostName = requestUrl.getHost().toLowerCase(Locale.getDefault());
2525
return validGraphHostNames.contains(hostName);

‎src/main/java/com/microsoft/graph/authentication/TokenCredentialAuthProvider.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class TokenCredentialAuthProvider extends BaseAuthenticationProvider {
2626
* @param tokenCredential Credential object inheriting the TokenCredential interface used to instantiate the Auth Provider
2727
*/
2828
public TokenCredentialAuthProvider(@Nonnull final TokenCredential tokenCredential) {
29-
this(Arrays.asList(new String[] {DEFAULT_GRAPH_SCOPE}), tokenCredential);
29+
this(Arrays.asList(DEFAULT_GRAPH_SCOPE), tokenCredential);
3030
}
3131

3232
/**

‎src/test/java/com/microsoft/graph/authentication/TokenCredentialAuthProviderTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void providerDoesntAddTokenOnInvalidHostName() throws MalformedURLExcepti
4646
assertNull(token);
4747
}
4848
@Test
49-
public void providerDefensivePrograming() {
49+
public void providerDefensiveProgramming() {
5050
assertThrows("should throw on null credentials", IllegalArgumentException.class, () -> { new TokenCredentialAuthProvider(null); });
5151
assertThrows("should throw on null scopes", IllegalArgumentException.class, () -> { new TokenCredentialAuthProvider(null, mock(TokenCredential.class)); });
5252
assertThrows("should throw on empty scopes", IllegalArgumentException.class, () -> { new TokenCredentialAuthProvider(new ArrayList<String>(), mock(TokenCredential.class)); });

0 commit comments

Comments
 (0)