From 225dc593a84848f227c353403acdab4eb23b9df9 Mon Sep 17 00:00:00 2001 From: Jon Kjennbakken Date: Fri, 6 Jan 2023 09:23:17 +0100 Subject: [PATCH] Polish NimbusJwtDecoderTests - Add missing mock Closes gh-12238 --- .../security/oauth2/jwt/NimbusJwtDecoderTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oauth2/oauth2-jose/src/test/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderTests.java b/oauth2/oauth2-jose/src/test/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderTests.java index 758fc476c0..a4e5a75706 100644 --- a/oauth2/oauth2-jose/src/test/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderTests.java +++ b/oauth2/oauth2-jose/src/test/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderTests.java @@ -60,6 +60,7 @@ import org.mockito.ArgumentCaptor; import org.springframework.cache.Cache; import org.springframework.cache.concurrent.ConcurrentMapCache; +import org.springframework.cache.support.SimpleValueWrapper; import org.springframework.core.convert.converter.Converter; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -700,6 +701,7 @@ public class NimbusJwtDecoderTests { RestOperations restOperations = mock(RestOperations.class); Cache cache = mock(Cache.class); given(cache.get(eq(JWK_SET_URI), eq(String.class))).willReturn(JWK_SET); + given(cache.get(eq(JWK_SET_URI))).willReturn(new SimpleValueWrapper(JWK_SET)); given(restOperations.exchange(any(RequestEntity.class), eq(String.class))) .willReturn(new ResponseEntity<>(NEW_KID_JWK_SET, HttpStatus.OK));