test_class.declarator: LATCH_TIMEOUT = 20L
test_class.modifier: private static final
test_class.original_string: private static final Long LATCH_TIMEOUT = 20L;
test_class.type: Long
test_class.var_name: LATCH_TIMEOUT
test_class.declarator: DISCOVERY_ENDPOINT_REQUEST =
              HttpRequest.GET("https://google.com/.well-known/openid-configuration")
test_class.modifier: private static final
test_class.original_string: private static final HttpRequest DISCOVERY_ENDPOINT_REQUEST =
              HttpRequest.GET("https://google.com/.well-known/openid-configuration");
test_class.type: HttpRequest
test_class.var_name: DISCOVERY_ENDPOINT_REQUEST
test_class.declarator: JWKS_URI = "https://the.uri.com"
test_class.modifier: private static final
test_class.original_string: private static final String JWKS_URI = "https://the.uri.com";
test_class.type: String
test_class.var_name: JWKS_URI
test_class.declarator: PUBLIC_KEYS_REQUEST = HttpRequest.GET(JWKS_URI)
test_class.modifier: private static final
test_class.original_string: private static final HttpRequest PUBLIC_KEYS_REQUEST = HttpRequest.GET(JWKS_URI);
test_class.type: HttpRequest
test_class.var_name: PUBLIC_KEYS_REQUEST
test_class.declarator: KEY_ID = "cc34c0a0-bd5a-4a3c-a50d-a2a7db7643df"
test_class.modifier: private static final
test_class.original_string: private static final String KEY_ID = "cc34c0a0-bd5a-4a3c-a50d-a2a7db7643df";
test_class.type: String
test_class.var_name: KEY_ID
test_class.declarator: actorSystem
test_class.modifier: private
test_class.original_string: private ActorSystem actorSystem;
test_class.type: ActorSystem
test_class.var_name: actorSystem
test_class.declarator: underTest
test_class.modifier: private
test_class.original_string: private PublicKeyProvider underTest;
test_class.type: PublicKeyProvider
test_class.var_name: underTest
test_class.declarator: httpClientMock
test_class.modifier: @Mock
      public
test_class.original_string: @Mock
      public HttpClientFacade httpClientMock;
test_class.type: HttpClientFacade
test_class.var_name: httpClientMock
test_class.declarator: cacheConfigMock
test_class.modifier: @Mock
      public
test_class.original_string: @Mock
      public CacheConfig cacheConfigMock;
test_class.type: CacheConfig
test_class.var_name: cacheConfigMock
test_class.file: services/gateway/security/src/test/java/org/eclipse/ditto/services/gateway/security/authentication/jwt/DittoPublicKeyProviderTest.java
test_class.identifier: DittoPublicKeyProviderTest
test_case.body: @Test
      public void verifyThatKeyIsNotCachedIfResponseDoesNotContainKeyId()
              throws InterruptedException, ExecutionException, TimeoutException {
  
          mockSuccessfulDiscoveryEndpointRequest();
          mockSuccessfulPublicKeysRequestWithoutMatchingKeyId();
  
          assertThat(underTest.getPublicKey("google.com", KEY_ID).get(LATCH_TIMEOUT, TimeUnit.SECONDS)).isEmpty();
          verify(httpClientMock).createSingleHttpRequest(DISCOVERY_ENDPOINT_REQUEST);
          verify(httpClientMock).createSingleHttpRequest(PUBLIC_KEYS_REQUEST);
  
          Mockito.clearInvocations(httpClientMock);
  
          assertThat(underTest.getPublicKey("google.com", KEY_ID).get(LATCH_TIMEOUT, TimeUnit.SECONDS)).isEmpty();
          verify(httpClientMock).createSingleHttpRequest(DISCOVERY_ENDPOINT_REQUEST);
          verify(httpClientMock).createSingleHttpRequest(PUBLIC_KEYS_REQUEST);
      }
test_case.class_method_signature: DittoPublicKeyProviderTest.verifyThatKeyIsNotCachedIfResponseDoesNotContainKeyId()
test_case.full_signature: @Test public void verifyThatKeyIsNotCachedIfResponseDoesNotContainKeyId()
test_case.identifier: verifyThatKeyIsNotCachedIfResponseDoesNotContainKeyId
test_case.invocations: mockSuccessfulDiscoveryEndpointRequest mockSuccessfulPublicKeysRequestWithoutMatchingKeyId isEmpty assertThat get getPublicKey createSingleHttpRequest verify createSingleHttpRequest verify clearInvocations isEmpty assertThat get getPublicKey createSingleHttpRequest verify createSingleHttpRequest verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void verifyThatKeyIsNotCachedIfResponseDoesNotContainKeyId()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(DittoPublicKeyProvider.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(DittoPublicKeyProvider.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: JWK_REQUEST_TIMEOUT_MILLISECONDS = 5000
focal_class.modifier: private static final
focal_class.original_string: private static final long JWK_REQUEST_TIMEOUT_MILLISECONDS = 5000;
focal_class.type: long
focal_class.var_name: JWK_REQUEST_TIMEOUT_MILLISECONDS
focal_class.declarator: OPENID_CONNECT_DISCOVERY_PATH = "/.well-known/openid-configuration"
focal_class.modifier: private static final
focal_class.original_string: private static final String OPENID_CONNECT_DISCOVERY_PATH = "/.well-known/openid-configuration";
focal_class.type: String
focal_class.var_name: OPENID_CONNECT_DISCOVERY_PATH
focal_class.declarator: HTTPS = "https://"
focal_class.modifier: private static final
focal_class.original_string: private static final String HTTPS = "https://";
focal_class.type: String
focal_class.var_name: HTTPS
focal_class.declarator: JSON_JWKS_URI = JsonFieldDefinition.ofString("jwks_uri")
focal_class.modifier: private static final
focal_class.original_string: private static final JsonFieldDefinition<String> JSON_JWKS_URI = JsonFieldDefinition.ofString("jwks_uri");
focal_class.type: JsonFieldDefinition<String>
focal_class.var_name: JSON_JWKS_URI
focal_class.declarator: jwtSubjectIssuersConfig
focal_class.modifier: private final
focal_class.original_string: private final JwtSubjectIssuersConfig jwtSubjectIssuersConfig;
focal_class.type: JwtSubjectIssuersConfig
focal_class.var_name: jwtSubjectIssuersConfig
focal_class.declarator: httpClient
focal_class.modifier: private final
focal_class.original_string: private final HttpClientFacade httpClient;
focal_class.type: HttpClientFacade
focal_class.var_name: httpClient
focal_class.declarator: publicKeyCache
focal_class.modifier: private final
focal_class.original_string: private final Cache<PublicKeyIdWithIssuer, PublicKey> publicKeyCache;
focal_class.type: Cache<PublicKeyIdWithIssuer, PublicKey>
focal_class.var_name: publicKeyCache
focal_class.file: services/gateway/security/src/main/java/org/eclipse/ditto/services/gateway/security/authentication/jwt/DittoPublicKeyProvider.java
focal_class.identifier: DittoPublicKeyProvider
focal_class.interfaces: implements PublicKeyProvider
focal_class.class_method_signature: DittoPublicKeyProvider.DittoPublicKeyProvider(final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysConfig,
              final String cacheName)
focal_class.full_signature: private  DittoPublicKeyProvider(final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysConfig,
              final String cacheName)
focal_class.identifier: DittoPublicKeyProvider
focal_class.modifiers: private
focal_class.parameters: (final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysConfig,
              final String cacheName)
focal_class.signature:  DittoPublicKeyProvider(final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysConfig,
              final String cacheName)
focal_class.class_method_signature: DittoPublicKeyProvider.of(final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysCacheConfig,
              final String cacheName)
focal_class.full_signature: public static PublicKeyProvider of(final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysCacheConfig,
              final String cacheName)
focal_class.identifier: of
focal_class.modifiers: public static
focal_class.parameters: (final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysCacheConfig,
              final String cacheName)
focal_class.return: PublicKeyProvider
focal_class.signature: PublicKeyProvider of(final JwtSubjectIssuersConfig jwtSubjectIssuersConfig,
              final HttpClientFacade httpClient,
              final CacheConfig publicKeysCacheConfig,
              final String cacheName)
focal_class.class_method_signature: DittoPublicKeyProvider.getPublicKey(final String issuer, final String keyId)
focal_class.full_signature: @Override public CompletableFuture<Optional<PublicKey>> getPublicKey(final String issuer, final String keyId)
focal_class.identifier: getPublicKey
focal_class.modifiers: @Override public
focal_class.parameters: (final String issuer, final String keyId)
focal_class.return: CompletableFuture<Optional<PublicKey>>
focal_class.signature: CompletableFuture<Optional<PublicKey>> getPublicKey(final String issuer, final String keyId)
focal_class.class_method_signature: DittoPublicKeyProvider.loadPublicKey(final PublicKeyIdWithIssuer publicKeyIdWithIssuer,
              final Executor executor)
focal_class.full_signature: private CompletableFuture<PublicKey> loadPublicKey(final PublicKeyIdWithIssuer publicKeyIdWithIssuer,
              final Executor executor)
focal_class.identifier: loadPublicKey
focal_class.modifiers: private
focal_class.parameters: (final PublicKeyIdWithIssuer publicKeyIdWithIssuer,
              final Executor executor)
focal_class.return: CompletableFuture<PublicKey>
focal_class.signature: CompletableFuture<PublicKey> loadPublicKey(final PublicKeyIdWithIssuer publicKeyIdWithIssuer,
              final Executor executor)
focal_class.class_method_signature: DittoPublicKeyProvider.getDiscoveryEndpoint(final String issuer)
focal_class.full_signature: private String getDiscoveryEndpoint(final String issuer)
focal_class.identifier: getDiscoveryEndpoint
focal_class.modifiers: private
focal_class.parameters: (final String issuer)
focal_class.return: String
focal_class.signature: String getDiscoveryEndpoint(final String issuer)
focal_class.class_method_signature: DittoPublicKeyProvider.mapResponseToJsonArray(final HttpResponse response)
focal_class.full_signature: private CompletableFuture<JsonArray> mapResponseToJsonArray(final HttpResponse response)
focal_class.identifier: mapResponseToJsonArray
focal_class.modifiers: private
focal_class.parameters: (final HttpResponse response)
focal_class.return: CompletableFuture<JsonArray>
focal_class.signature: CompletableFuture<JsonArray> mapResponseToJsonArray(final HttpResponse response)
focal_class.class_method_signature: DittoPublicKeyProvider.getPublicKeysFromDiscoveryEndpoint(final String discoveryEndpoint)
focal_class.full_signature: private HttpResponse getPublicKeysFromDiscoveryEndpoint(final String discoveryEndpoint)
focal_class.identifier: getPublicKeysFromDiscoveryEndpoint
focal_class.modifiers: private
focal_class.parameters: (final String discoveryEndpoint)
focal_class.return: HttpResponse
focal_class.signature: HttpResponse getPublicKeysFromDiscoveryEndpoint(final String discoveryEndpoint)
focal_class.class_method_signature: DittoPublicKeyProvider.extractDittoRuntimeException(final ExecutionException e,
              final String discoveryEndpoint)
focal_class.full_signature: private static DittoRuntimeException extractDittoRuntimeException(final ExecutionException e,
              final String discoveryEndpoint)
focal_class.identifier: extractDittoRuntimeException
focal_class.modifiers: private static
focal_class.parameters: (final ExecutionException e,
              final String discoveryEndpoint)
focal_class.return: DittoRuntimeException
focal_class.signature: DittoRuntimeException extractDittoRuntimeException(final ExecutionException e,
              final String discoveryEndpoint)
focal_class.class_method_signature: DittoPublicKeyProvider.mapResponseToJsonObject(final HttpResponse response)
focal_class.full_signature: private CompletionStage<JsonObject> mapResponseToJsonObject(final HttpResponse response)
focal_class.identifier: mapResponseToJsonObject
focal_class.modifiers: private
focal_class.parameters: (final HttpResponse response)
focal_class.return: CompletionStage<JsonObject>
focal_class.signature: CompletionStage<JsonObject> mapResponseToJsonObject(final HttpResponse response)
focal_class.class_method_signature: DittoPublicKeyProvider.handleNonSuccessResponse(final HttpResponse response)
focal_class.full_signature: private void handleNonSuccessResponse(final HttpResponse response)
focal_class.identifier: handleNonSuccessResponse
focal_class.modifiers: private
focal_class.parameters: (final HttpResponse response)
focal_class.return: void
focal_class.signature: void handleNonSuccessResponse(final HttpResponse response)
focal_class.class_method_signature: DittoPublicKeyProvider.getBodyAsString(final HttpResponse response)
focal_class.full_signature: private CompletionStage<String> getBodyAsString(final HttpResponse response)
focal_class.identifier: getBodyAsString
focal_class.modifiers: private
focal_class.parameters: (final HttpResponse response)
focal_class.return: CompletionStage<String>
focal_class.signature: CompletionStage<String> getBodyAsString(final HttpResponse response)
focal_class.class_method_signature: DittoPublicKeyProvider.handleUnexpectedException(final Throwable e,
              final String discoveryEndpoint)
focal_class.full_signature: private static PublicKeyProviderUnavailableException handleUnexpectedException(final Throwable e,
              final String discoveryEndpoint)
focal_class.identifier: handleUnexpectedException
focal_class.modifiers: private static
focal_class.parameters: (final Throwable e,
              final String discoveryEndpoint)
focal_class.return: PublicKeyProviderUnavailableException
focal_class.signature: PublicKeyProviderUnavailableException handleUnexpectedException(final Throwable e,
              final String discoveryEndpoint)
focal_class.class_method_signature: DittoPublicKeyProvider.mapToPublicKey(final JsonArray publicKeys, final String keyId,
              final String discoveryEndpoint)
focal_class.full_signature: private static PublicKey mapToPublicKey(final JsonArray publicKeys, final String keyId,
              final String discoveryEndpoint)
focal_class.identifier: mapToPublicKey
focal_class.modifiers: private static
focal_class.parameters: (final JsonArray publicKeys, final String keyId,
              final String discoveryEndpoint)
focal_class.return: PublicKey
focal_class.signature: PublicKey mapToPublicKey(final JsonArray publicKeys, final String keyId,
              final String discoveryEndpoint)
focal_method.body: @Override
      public CompletableFuture<Optional<PublicKey>> getPublicKey(final String issuer, final String keyId) {
          argumentNotNull(issuer);
          argumentNotNull(keyId);
  
          return publicKeyCache.get(PublicKeyIdWithIssuer.of(keyId, issuer));
      }
focal_method.class_method_signature: DittoPublicKeyProvider.getPublicKey(final String issuer, final String keyId)
focal_method.full_signature: @Override public CompletableFuture<Optional<PublicKey>> getPublicKey(final String issuer, final String keyId)
focal_method.identifier: getPublicKey
focal_method.invocations: argumentNotNull argumentNotNull get of
focal_method.modifiers: @Override public
focal_method.parameters: (final String issuer, final String keyId)
focal_method.return: CompletableFuture<Optional<PublicKey>>
focal_method.signature: CompletableFuture<Optional<PublicKey>> getPublicKey(final String issuer, final String keyId)