9
9
import java .io .UnsupportedEncodingException ;
10
10
import java .net .URL ;
11
11
import java .net .URLDecoder ;
12
- import java .util .Collections ;
13
- import java .util .HashMap ;
14
- import java .util .Map ;
15
- import java .util .Set ;
16
- import java .util .HashSet ;
12
+ import java .util .*;
17
13
18
14
public class AuthorizationRequestUrlParametersTest {
19
15
@@ -57,7 +53,7 @@ public void testBuilder_onlyRequiredParameters() throws UnsupportedEncodingExcep
57
53
URLDecoder .decode (pair .substring (idx +1 ), "UTF-8" ));
58
54
}
59
55
60
- Assert .assertEquals (queryParameters .get ("scope" ), "offline_access openid profile scope" );
56
+ Assert .assertEquals (queryParameters .get ("scope" ), "openid profile offline_access scope" );
61
57
Assert .assertEquals (queryParameters .get ("response_type" ), "code" );
62
58
Assert .assertEquals (queryParameters .get ("redirect_uri" ), "http://localhost:8080" );
63
59
Assert .assertEquals (queryParameters .get ("client_id" ), "client_id" );
@@ -89,6 +85,7 @@ public void testBuilder_optionalParameters() throws UnsupportedEncodingException
89
85
AuthorizationRequestUrlParameters parameters =
90
86
AuthorizationRequestUrlParameters
91
87
.builder (redirectUri , scope )
88
+ .extraScopesToConsent (new LinkedHashSet <>(Arrays .asList ("extraScopeToConsent1" , "extraScopeToConsent2" )))
92
89
.responseMode (ResponseMode .QUERY )
93
90
.codeChallenge ("challenge" )
94
91
.codeChallengeMethod ("method" )
@@ -114,7 +111,8 @@ public void testBuilder_optionalParameters() throws UnsupportedEncodingException
114
111
URLDecoder .decode (pair .substring (idx +1 ), "UTF-8" ));
115
112
}
116
113
117
- Assert .assertEquals (queryParameters .get ("scope" ), "offline_access openid profile scope" );
114
+ Assert .assertEquals (queryParameters .get ("scope" ),
115
+ "openid profile offline_access scope extraScopeToConsent1 extraScopeToConsent2" );
118
116
Assert .assertEquals (queryParameters .get ("response_type" ), "code" );
119
117
Assert .assertEquals (queryParameters .get ("redirect_uri" ), "http://localhost:8080" );
120
118
Assert .assertEquals (queryParameters .get ("client_id" ), "client_id" );
0 commit comments