Skip to content

Commit 225dc59

Browse files
jonkjennjzheaux
authored andcommitted
Polish NimbusJwtDecoderTests
- Add missing mock Closes gh-12238
1 parent 3cfaf0d commit 225dc59

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

oauth2/oauth2-jose/src/test/java/org/springframework/security/oauth2/jwt/NimbusJwtDecoderTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
import org.springframework.cache.Cache;
6262
import org.springframework.cache.concurrent.ConcurrentMapCache;
63+
import org.springframework.cache.support.SimpleValueWrapper;
6364
import org.springframework.core.convert.converter.Converter;
6465
import org.springframework.http.HttpStatus;
6566
import org.springframework.http.MediaType;
@@ -700,6 +701,7 @@ public void decodeWhenCacheAndUnknownKidShouldTriggerFetchOfJwkSet() throws JOSE
700701
RestOperations restOperations = mock(RestOperations.class);
701702
Cache cache = mock(Cache.class);
702703
given(cache.get(eq(JWK_SET_URI), eq(String.class))).willReturn(JWK_SET);
704+
given(cache.get(eq(JWK_SET_URI))).willReturn(new SimpleValueWrapper(JWK_SET));
703705
given(restOperations.exchange(any(RequestEntity.class), eq(String.class)))
704706
.willReturn(new ResponseEntity<>(NEW_KID_JWK_SET, HttpStatus.OK));
705707

0 commit comments

Comments
 (0)