Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kondo19 committed Sep 14, 2023
1 parent f1e815b commit 6be02e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public AuthorizationCodeFlow(
tokenServerUrl,
clientAuthentication,
clientId,
authorizationServerEncodedUrl,
additionalParameters)
authorizationServerEncodedUrl)
.setAdditionalParameters(additionalParameters)
);
}

Expand All @@ -184,7 +184,7 @@ protected AuthorizationCodeFlow(Builder builder) {
clientId = Preconditions.checkNotNull(builder.clientId);
authorizationServerEncodedUrl =
Preconditions.checkNotNull(builder.authorizationServerEncodedUrl);
additionalParameters = Preconditions.checkNotNull(builder.additionalParameters);
additionalParameters = builder.additionalParameters;
requestInitializer = builder.requestInitializer;
credentialStore = builder.credentialStore;
credentialDataStore = builder.credentialDataStore;
Expand Down Expand Up @@ -616,25 +616,6 @@ public Builder(
setAdditionalParameters(Collections.<String, String>emptyMap());
}

public Builder(
AccessMethod method,
HttpTransport transport,
JsonFactory jsonFactory,
GenericUrl tokenServerUrl,
HttpExecuteInterceptor clientAuthentication,
String clientId,
String authorizationServerEncodedUrl,
Map<String, String> additionalParameters) {
setMethod(method);
setTransport(transport);
setJsonFactory(jsonFactory);
setTokenServerUrl(tokenServerUrl);
setClientAuthentication(clientAuthentication);
setClientId(clientId);
setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl);
setAdditionalParameters(additionalParameters);
}

/** Returns a new instance of an authorization code flow based on this builder. */
public AuthorizationCodeFlow build() {
return new AuthorizationCodeFlow(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,4 @@ public void testBuild() {
assertEquals(EXPECTED, url.build());
}

/*
public void testAdditionalParams() {
Map<String, String> testMap = new HashMap<>();
String expectedUrl =
"https://server.example.com/authorize?client_id=s6BhdRkqt3&"
+ "redirect_uri=https://client.example.com/rd&response_type=code"
+ "&scope=a%20b%20c&state=xyz&param1=value1";
testMap.put("param1", "value1");
AuthorizationRequestUrl url =
new AuthorizationCodeRequestUrl("https://server.example.com/authorize", "s6BhdRkqt3")
.setState("xyz")
.setRedirectUri("https://client.example.com/rd")
.setScopes(Arrays.asList("a", "b", "c"));
assertEquals(expectedUrl, url.build());
}
*/

}

0 comments on commit 6be02e8

Please sign in to comment.