@Override
  public JWKSet getJWKSet(JWKSetCacheRefreshEvaluator refreshEvaluator, long currentTime, T context)
      throws KeySourceException {
    var jwksUrl = discoverJwksUrl();
    try (var jwkSetSource = new URLBasedJWKSetSource<>(jwksUrl, new HttpRetriever(httpClient))) {
      return jwkSetSource.getJWKSet(null, 0, context);
    } catch (IOException e) {
      throw new RemoteKeySourceException(
          "failed to fetch jwks from discovery document '%s'".formatted(discoveryUrl), e);
    }
  }
@Test
  void getJWKSet_success(WireMockRuntimeInfo wm) throws KeySourceException {

    var kid = "test";
    var jwks =
        """
    {
      "keys": [
        {
          "kty": "EC",
          "use": "sig",
          "crv": "P-256",
          "kid": "%s",
          "x": "PFjgWFHOCAtnw47F3bT99fmWOKcDARN45JGEPgB8yKs",
          "y": "sFR6D_6Pa1vRRc5OfQNsetnN8EkXNliEipaip2L2OBg"
        }
      ]
    }
    """
            .formatted(kid);

    var discoveryUrl = URI.create(wm.getHttpBaseUrl()).resolve(DISCOVERY_PATH);

    var jwksUrl = URI.create(wm.getHttpBaseUrl()).resolve(JWKS_PATH);

    stubFor(get(DISCOVERY_PATH).willReturn(okJson("{\"jwks_uri\": \"%s\"}".formatted(jwksUrl))));

    stubFor(get(JWKS_PATH).willReturn(okJson(jwks)));

    var sut = new DiscoveryJwkSetSource<>(HttpClient.newHttpClient(), discoveryUrl);

    var gotJwks = sut.getJWKSet(null, 0, null);
    assertNotNull(gotJwks.getKeyByKeyId(kid));
    assertEquals(1, gotJwks.getKeys().size());
  }