test_class.declarator: factory
test_class.modifier: @Spy
      private
test_class.original_string: @Spy
      private KeycloakClientRequestFactory factory;
test_class.type: KeycloakClientRequestFactory
test_class.var_name: factory
test_class.declarator: account
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private OidcKeycloakAccount account;
test_class.type: OidcKeycloakAccount
test_class.var_name: account
test_class.declarator: keycloakAuthenticationToken
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private KeycloakAuthenticationToken keycloakAuthenticationToken;
test_class.type: KeycloakAuthenticationToken
test_class.var_name: keycloakAuthenticationToken
test_class.declarator: keycloakSecurityContext
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private KeycloakSecurityContext keycloakSecurityContext;
test_class.type: KeycloakSecurityContext
test_class.var_name: keycloakSecurityContext
test_class.declarator: request
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private HttpUriRequest request;
test_class.type: HttpUriRequest
test_class.var_name: request
test_class.declarator: bearerTokenString
test_class.modifier: private
test_class.original_string: private String bearerTokenString;
test_class.type: String
test_class.var_name: bearerTokenString
test_class.file: adapters/oidc/spring-security/src/test/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactoryTest.java
test_class.identifier: KeycloakClientRequestFactoryTest
test_case.body: @Test
      public void testGetKeycloakSecurityContext() throws Exception {
          KeycloakSecurityContext context = factory.getKeycloakSecurityContext();
          assertNotNull(context);
          assertEquals(keycloakSecurityContext, context);
      }
test_case.class_method_signature: KeycloakClientRequestFactoryTest.testGetKeycloakSecurityContext()
test_case.full_signature: @Test public void testGetKeycloakSecurityContext()
test_case.identifier: testGetKeycloakSecurityContext
test_case.invocations: getKeycloakSecurityContext assertNotNull assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetKeycloakSecurityContext()
focal_class.declarator: AUTHORIZATION_HEADER = "Authorization"
focal_class.modifier: public static final
focal_class.original_string: public static final String AUTHORIZATION_HEADER = "Authorization";
focal_class.type: String
focal_class.var_name: AUTHORIZATION_HEADER
focal_class.file: adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/client/KeycloakClientRequestFactory.java
focal_class.identifier: KeycloakClientRequestFactory
focal_class.interfaces: implements ClientHttpRequestFactory
focal_class.class_method_signature: KeycloakClientRequestFactory.KeycloakClientRequestFactory()
focal_class.full_signature: public  KeycloakClientRequestFactory()
focal_class.identifier: KeycloakClientRequestFactory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  KeycloakClientRequestFactory()
focal_class.class_method_signature: KeycloakClientRequestFactory.postProcessHttpRequest(HttpUriRequest request)
focal_class.full_signature: @Override protected void postProcessHttpRequest(HttpUriRequest request)
focal_class.identifier: postProcessHttpRequest
focal_class.modifiers: @Override protected
focal_class.parameters: (HttpUriRequest request)
focal_class.return: void
focal_class.signature: void postProcessHttpRequest(HttpUriRequest request)
focal_class.class_method_signature: KeycloakClientRequestFactory.getKeycloakSecurityContext()
focal_class.full_signature: protected KeycloakSecurityContext getKeycloakSecurityContext()
focal_class.identifier: getKeycloakSecurityContext
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: KeycloakSecurityContext
focal_class.signature: KeycloakSecurityContext getKeycloakSecurityContext()
focal_class.superclass: extends HttpComponentsClientHttpRequestFactory
focal_method.body: protected KeycloakSecurityContext getKeycloakSecurityContext() {
          Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
          KeycloakAuthenticationToken token;
          KeycloakSecurityContext context;
  
          if (authentication == null) {
              throw new IllegalStateException("Cannot set authorization header because there is no authenticated principal");
          }
  
          if (!KeycloakAuthenticationToken.class.isAssignableFrom(authentication.getClass())) {
              throw new IllegalStateException(
                      String.format(
                              "Cannot set authorization header because Authentication is of type %s but %s is required",
                              authentication.getClass(), KeycloakAuthenticationToken.class)
              );
          }
  
          token = (KeycloakAuthenticationToken) authentication;
          context = token.getAccount().getKeycloakSecurityContext();
  
          return context;
      }
focal_method.class_method_signature: KeycloakClientRequestFactory.getKeycloakSecurityContext()
focal_method.full_signature: protected KeycloakSecurityContext getKeycloakSecurityContext()
focal_method.identifier: getKeycloakSecurityContext
focal_method.invocations: getAuthentication getContext isAssignableFrom getClass format getClass getKeycloakSecurityContext getAccount
focal_method.modifiers: protected
focal_method.parameters: ()
focal_method.return: KeycloakSecurityContext
focal_method.signature: KeycloakSecurityContext getKeycloakSecurityContext()