File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
main/java/com/bunq/sdk/model/core
test/java/com/bunq/sdk/model/core Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 77import com .bunq .sdk .util .HttpUtil ;
88
99import java .util .HashMap ;
10+ import java .util .LinkedHashMap ;
1011import java .util .Map ;
1112
1213public class OauthAuthorizationUri extends BunqModel {
@@ -66,13 +67,13 @@ public static OauthAuthorizationUri create(
6667 final String redirectUri ,
6768 final OauthClient client
6869 ) {
69- Map <String , String > allRequestParameter = new HashMap <String , String >() {
70- {
71- put (FIELD_REDIRECT_URI , redirectUri );
72- put ( FIELD_RESPONSE_TYPE , responseType . toString ());
73- put ( FIELD_CLIENT_ID , client .getClientId ());
74- }
75- };
70+ Map <String , String > allRequestParameter = new LinkedHashMap <String , String >();
71+ allRequestParameter . put ( FIELD_REDIRECT_URI , redirectUri );
72+ allRequestParameter . put (FIELD_RESPONSE_TYPE , responseType . toString () );
73+
74+ if ( client .getClientId () != null ) {
75+ allRequestParameter . put ( FIELD_CLIENT_ID , client . getClientId ());
76+ }
7677
7778 return new OauthAuthorizationUri (
7879 String .format (determineAuthUriFormat (), HttpUtil .createQueryString (allRequestParameter ))
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class OauthAuthorizationUriTest extends BunqSdkTestBase {
99 /**
1010 * Test constants.
1111 */
12- private static final String TEST_EXPECT_URI = "https://oauth.sandbox.bunq.com/auth?response_type=code& redirect_uri=redirecturi&client_id=null &state=state" ;
12+ private static final String TEST_EXPECT_URI = "https://oauth.sandbox.bunq.com/auth?redirect_uri=redirecturi&response_type=code &state=state" ;
1313 private static final String TEST_REDIRECT_URI = "redirecturi" ;
1414 private static final String TEST_STATUS = "status" ;
1515 private static final String TEST_STATE = "state" ;
You can’t perform that action at this time.
0 commit comments