@@ -222,8 +222,8 @@ void resolveWhenQueryParameterHasMultipleAccessTokensThenOAuth2AuthenticationExc
222222 @ Test
223223 void resolveWhenBodyParameterIsPresentThenTokenIsResolved () {
224224 this .converter .setAllowFormEncodedBodyParameter (true );
225- var request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
226- .body ("access_token=" + TEST_TOKEN );
225+ MockServerHttpRequest request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
226+ .body ("access_token=" + TEST_TOKEN );
227227
228228 assertThat (convertToToken (request ).getToken ()).isEqualTo (TEST_TOKEN );
229229 }
@@ -232,17 +232,17 @@ void resolveWhenBodyParameterIsPresentThenTokenIsResolved() {
232232 @ Test
233233 void resolveWhenBodyParameterIsPresentButNotAllowedThenTokenIsNotResolved () {
234234 this .converter .setAllowFormEncodedBodyParameter (false );
235- var request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
236- .body ("access_token=" + TEST_TOKEN );
235+ MockServerHttpRequest request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
236+ .body ("access_token=" + TEST_TOKEN );
237237
238238 assertThat (convertToToken (request )).isNull ();
239239 }
240240
241241 @ Test
242242 void resolveWhenBodyParameterHasMultipleAccessTokensThenOAuth2AuthenticationException () {
243243 this .converter .setAllowFormEncodedBodyParameter (true );
244- var request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
245- .body ("access_token=" + TEST_TOKEN + "&access_token=" + TEST_TOKEN );
244+ MockServerHttpRequest request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
245+ .body ("access_token=" + TEST_TOKEN + "&access_token=" + TEST_TOKEN );
246246
247247 assertThatExceptionOfType (OAuth2AuthenticationException .class )
248248 .isThrownBy (() -> convertToToken (request ))
@@ -258,35 +258,35 @@ void resolveWhenBodyParameterHasMultipleAccessTokensThenOAuth2AuthenticationExce
258258 @ Test
259259 void resolveBodyContainsOtherParameterAsWellThenTokenIsResolved () {
260260 this .converter .setAllowFormEncodedBodyParameter (true );
261- var request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
262- .body ("access_token=" + TEST_TOKEN + "&other_param=value" );
261+ MockServerHttpRequest request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
262+ .body ("access_token=" + TEST_TOKEN + "&other_param=value" );
263263
264264 assertThat (convertToToken (request ).getToken ()).isEqualTo (TEST_TOKEN );
265265 }
266266
267267 @ Test
268268 void resolveWhenNoBodyParameterThenTokenIsNotResolved () {
269269 this .converter .setAllowFormEncodedBodyParameter (true );
270- var request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED );
270+ MockServerHttpRequest . BaseBuilder <?> request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED );
271271
272272 assertThat (convertToToken (request )).isNull ();
273273 }
274274
275275 @ Test
276276 void resolveWhenWrongBodyParameterThenTokenIsNotResolved () {
277277 this .converter .setAllowFormEncodedBodyParameter (true );
278- var request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
279- .body ("other_param=value" );
278+ MockServerHttpRequest request = post ("/" ).contentType (APPLICATION_FORM_URLENCODED )
279+ .body ("other_param=value" );
280280
281281 assertThat (convertToToken (request )).isNull ();
282282 }
283283
284284 @ Test
285285 void resolveWhenValidHeaderIsPresentTogetherWithBodyParameterThenAuthenticationExceptionIsThrown () {
286286 this .converter .setAllowFormEncodedBodyParameter (true );
287- var request = post ("/" ).header (AUTHORIZATION , "Bearer " + TEST_TOKEN )
288- .contentType (APPLICATION_FORM_URLENCODED )
289- .body ("access_token=" + TEST_TOKEN );
287+ MockServerHttpRequest request = post ("/" ).header (AUTHORIZATION , "Bearer " + TEST_TOKEN )
288+ .contentType (APPLICATION_FORM_URLENCODED )
289+ .body ("access_token=" + TEST_TOKEN );
290290
291291 assertThatExceptionOfType (OAuth2AuthenticationException .class )
292292 .isThrownBy (() -> convertToToken (request ))
@@ -297,9 +297,9 @@ void resolveWhenValidHeaderIsPresentTogetherWithBodyParameterThenAuthenticationE
297297 void resolveWhenValidQueryParameterIsPresentTogetherWithBodyParameterThenAuthenticationExceptionIsThrown () {
298298 this .converter .setAllowUriQueryParameter (true );
299299 this .converter .setAllowFormEncodedBodyParameter (true );
300- var request = post ("/" ).queryParam ("access_token" , TEST_TOKEN )
301- .contentType (APPLICATION_FORM_URLENCODED )
302- .body ("access_token=" + TEST_TOKEN );
300+ MockServerHttpRequest request = post ("/" ).queryParam ("access_token" , TEST_TOKEN )
301+ .contentType (APPLICATION_FORM_URLENCODED )
302+ .body ("access_token=" + TEST_TOKEN );
303303
304304 assertThatExceptionOfType (OAuth2AuthenticationException .class )
305305 .isThrownBy (() -> convertToToken (request ))
@@ -310,10 +310,10 @@ void resolveWhenValidQueryParameterIsPresentTogetherWithBodyParameterThenAuthent
310310 void resolveWhenValidQueryParameterIsPresentTogetherWithBodyParameterAndValidHeaderThenAuthenticationExceptionIsThrown () {
311311 this .converter .setAllowUriQueryParameter (true );
312312 this .converter .setAllowFormEncodedBodyParameter (true );
313- var request = post ("/" ).header (AUTHORIZATION , "Bearer " + TEST_TOKEN )
314- .queryParam ("access_token" , TEST_TOKEN )
315- .contentType (APPLICATION_FORM_URLENCODED )
316- .body ("access_token=" + TEST_TOKEN );
313+ MockServerHttpRequest request = post ("/" ).header (AUTHORIZATION , "Bearer " + TEST_TOKEN )
314+ .queryParam ("access_token" , TEST_TOKEN )
315+ .contentType (APPLICATION_FORM_URLENCODED )
316+ .body ("access_token=" + TEST_TOKEN );
317317
318318 assertThatExceptionOfType (OAuth2AuthenticationException .class )
319319 .isThrownBy (() -> convertToToken (request ))
0 commit comments