1919import java .security .interfaces .RSAPrivateKey ;
2020import java .security .interfaces .RSAPublicKey ;
2121import java .util .Date ;
22+ import java .util .HashMap ;
2223
2324import static org .assertj .core .api .Assertions .assertThat ;
2425import static org .mockito .ArgumentMatchers .anyString ;
@@ -80,7 +81,7 @@ public void constructor_shouldRejectNullJwkProvider() {
8081 public void validateToken_success () throws Exception {
8182 String token = validToken ();
8283
83- DecodedJWT jwt = validator .validateToken (token , null );
84+ DecodedJWT jwt = validator .validateToken (token , null , null );
8485
8586 assertThat (jwt .getIssuer ()).isEqualTo (ISSUER );
8687 assertThat (jwt .getAudience ()).contains (AUDIENCE );
@@ -89,7 +90,7 @@ public void validateToken_success() throws Exception {
8990
9091 @ Test (expected = MissingRequiredArgumentException .class )
9192 public void validateToken_shouldRejectNullToken () throws Exception {
92- validator .validateToken (null , null );
93+ validator .validateToken (null , null , null );
9394 }
9495
9596 @ Test (expected = VerifyAccessTokenException .class )
@@ -100,14 +101,14 @@ public void validateToken_shouldRejectInvalidSignature() throws Exception {
100101
101102 when (jwk .getPublicKey ()).thenReturn (wrongKey );
102103
103- validator .validateToken (validToken (), null );
104+ validator .validateToken (validToken (), null , null );
104105 }
105106
106107 @ Test
107108 public void validateTokenWithRequiredScopes_success () throws Exception {
108109 String token = tokenWithScopes ("read write" );
109110
110- DecodedJWT jwt = validator .validateTokenWithRequiredScopes (token , null , "read" );
111+ DecodedJWT jwt = validator .validateTokenWithRequiredScopes (token , new HashMap <>(), null , "read" );
111112
112113 assertThat (jwt ).isNotNull ();
113114 }
@@ -116,14 +117,14 @@ public void validateTokenWithRequiredScopes_success() throws Exception {
116117 public void validateTokenWithRequiredScopes_failure () throws Exception {
117118 String token = tokenWithScopes ("read" );
118119
119- validator .validateTokenWithRequiredScopes (token , null , "admin" );
120+ validator .validateTokenWithRequiredScopes (token , new HashMap <>(), null , "admin" );
120121 }
121122
122123 @ Test
123124 public void validateTokenWithAnyScope_success () throws Exception {
124125 String token = tokenWithScopes ("read write" );
125126
126- DecodedJWT jwt = validator .validateTokenWithAnyScope (token , null , "admin" , "write" );
127+ DecodedJWT jwt = validator .validateTokenWithAnyScope (token , new HashMap <>(), null , "admin" , "write" );
127128
128129 assertThat (jwt ).isNotNull ();
129130 }
@@ -132,14 +133,14 @@ public void validateTokenWithAnyScope_success() throws Exception {
132133 public void validateTokenWithAnyScope_failure () throws Exception {
133134 String token = tokenWithScopes ("read" );
134135
135- validator .validateTokenWithAnyScope (token , null , "admin" );
136+ validator .validateTokenWithAnyScope (token , new HashMap <>(), null , "admin" );
136137 }
137138
138139 @ Test
139140 public void validateTokenWithClaimEquals_success () throws Exception {
140141 String token = tokenWithEmail ("a@b.com" );
141142
142- DecodedJWT jwt = validator .validateTokenWithClaimEquals (token , null , "email" , "a@b.com" );
143+ DecodedJWT jwt = validator .validateTokenWithClaimEquals (token , new HashMap <>(), null , "email" , "a@b.com" );
143144
144145 assertThat (jwt ).isNotNull ();
145146 }
@@ -148,14 +149,14 @@ public void validateTokenWithClaimEquals_success() throws Exception {
148149 public void validateTokenWithClaimEquals_failure () throws Exception {
149150 String token = tokenWithEmail ("a@b.com" );
150151
151- validator .validateTokenWithClaimEquals (token , null , "email" , "x@y.com" );
152+ validator .validateTokenWithClaimEquals (token , new HashMap <>(), null , "email" , "x@y.com" );
152153 }
153154
154155 @ Test
155156 public void validateTokenWithClaimIncludes_success () throws Exception {
156157 String token = tokenWithScopes ("read write" );
157158
158- DecodedJWT jwt = validator .validateTokenWithClaimIncludes (token , null , "scope" , "read" );
159+ DecodedJWT jwt = validator .validateTokenWithClaimIncludes (token , new HashMap <>(), null , "scope" , "read" );
159160
160161 assertThat (jwt ).isNotNull ();
161162 }
@@ -164,14 +165,14 @@ public void validateTokenWithClaimIncludes_success() throws Exception {
164165 public void validateTokenWithClaimIncludes_failure () throws Exception {
165166 String token = tokenWithScopes ("read" );
166167
167- validator .validateTokenWithClaimIncludes (token , null , "scope" , "admin" );
168+ validator .validateTokenWithClaimIncludes (token , new HashMap <>(), null , "scope" , "admin" );
168169 }
169170
170171 @ Test
171172 public void validateTokenWithClaimIncludesAny_success () throws Exception {
172173 String token = tokenWithScopes ("read write" );
173174
174- DecodedJWT jwt = validator .validateTokenWithClaimIncludesAny (token , null , "scope" , "admin" , "write" );
175+ DecodedJWT jwt = validator .validateTokenWithClaimIncludesAny (token , new HashMap <>(), null , "scope" , "admin" , "write" );
175176
176177 assertThat (jwt ).isNotNull ();
177178 }
@@ -180,7 +181,7 @@ public void validateTokenWithClaimIncludesAny_success() throws Exception {
180181 public void validateTokenWithClaimIncludesAny_failure () throws Exception {
181182 String token = tokenWithScopes ("read" );
182183
183- validator .validateTokenWithClaimIncludesAny (token , null , "scope" , "admin" );
184+ validator .validateTokenWithClaimIncludesAny (token , new HashMap <>(), null , "scope" , "admin" );
184185 }
185186
186187 @ Test
0 commit comments