test_class.declarator: knownAuthorizationContext
test_class.modifier: private static
test_class.original_string: private static AuthorizationContext knownAuthorizationContext;
test_class.type: AuthorizationContext
test_class.var_name: knownAuthorizationContext
test_class.declarator: messageDispatcher
test_class.modifier: private static
test_class.original_string: private static Executor messageDispatcher;
test_class.type: Executor
test_class.var_name: messageDispatcher
test_class.declarator: testName = new TestName()
test_class.modifier: @Rule public final
test_class.original_string: @Rule public final TestName testName = new TestName();
test_class.type: TestName
test_class.var_name: testName
test_class.declarator: softly = new JUnitSoftAssertions()
test_class.modifier: @Rule public final
test_class.original_string: @Rule public final JUnitSoftAssertions softly = new JUnitSoftAssertions();
test_class.type: JUnitSoftAssertions
test_class.var_name: softly
test_class.declarator: authenticationProviderA
test_class.modifier: @Mock private
test_class.original_string: @Mock private AuthenticationProvider authenticationProviderA;
test_class.type: AuthenticationProvider
test_class.var_name: authenticationProviderA
test_class.declarator: authenticationProviderB
test_class.modifier: @Mock private
test_class.original_string: @Mock private AuthenticationProvider authenticationProviderB;
test_class.type: AuthenticationProvider
test_class.var_name: authenticationProviderB
test_class.declarator: authenticationFailureAggregator
test_class.modifier: @Mock private
test_class.original_string: @Mock private AuthenticationFailureAggregator authenticationFailureAggregator;
test_class.type: AuthenticationFailureAggregator
test_class.var_name: authenticationFailureAggregator
test_class.declarator: dittoHeaders
test_class.modifier: private
test_class.original_string: private DittoHeaders dittoHeaders;
test_class.type: DittoHeaders
test_class.var_name: dittoHeaders
test_class.file: services/gateway/security/src/test/java/org/eclipse/ditto/services/gateway/security/authentication/AuthenticationChainTest.java
test_class.identifier: AuthenticationChainTest
test_case.body: @Test
      public void authenticate() throws ExecutionException, InterruptedException {
          final RequestContext requestContextMock = mockRequestContextForAuthenticate();
          final AuthenticationResult expectedAuthenticationResult =
                  DefaultAuthenticationResult.successful(dittoHeaders, knownAuthorizationContext);
          when(authenticationProviderA.isApplicable(requestContextMock)).thenReturn(false);
          when(authenticationProviderB.isApplicable(requestContextMock)).thenReturn(true);
          when(authenticationProviderB.authenticate(requestContextMock, dittoHeaders))
                  .thenReturn(expectedAuthenticationResult);
          final AuthenticationChain underTest =
                  AuthenticationChain.getInstance(Arrays.asList(authenticationProviderA, authenticationProviderB),
                          authenticationFailureAggregator,
                          messageDispatcher);
  
          final AuthenticationResult authenticationResult =
                  underTest.authenticate(requestContextMock, dittoHeaders).get();
  
          verify(authenticationProviderA).isApplicable(requestContextMock);
          verify(authenticationProviderB).isApplicable(requestContextMock);
          verify(authenticationProviderA, never()).authenticate(requestContextMock, dittoHeaders);
          verify(authenticationProviderB).authenticate(requestContextMock, dittoHeaders);
          softly.assertThat(authenticationResult).isEqualTo(expectedAuthenticationResult);
      }
test_case.class_method_signature: AuthenticationChainTest.authenticate()
test_case.full_signature: @Test public void authenticate()
test_case.identifier: authenticate
test_case.invocations: mockRequestContextForAuthenticate successful thenReturn when isApplicable thenReturn when isApplicable thenReturn when authenticate getInstance asList get authenticate isApplicable verify isApplicable verify authenticate verify never authenticate verify isEqualTo assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void authenticate()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(AuthenticationChain.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticationChain.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: authenticationProviderChain
focal_class.modifier: private final
focal_class.original_string: private final Collection<AuthenticationProvider<?>> authenticationProviderChain;
focal_class.type: Collection<AuthenticationProvider<?>>
focal_class.var_name: authenticationProviderChain
focal_class.declarator: authenticationDispatcher
focal_class.modifier: private final
focal_class.original_string: private final Executor authenticationDispatcher;
focal_class.type: Executor
focal_class.var_name: authenticationDispatcher
focal_class.declarator: authenticationFailureAggregator
focal_class.modifier: private final
focal_class.original_string: private final AuthenticationFailureAggregator authenticationFailureAggregator;
focal_class.type: AuthenticationFailureAggregator
focal_class.var_name: authenticationFailureAggregator
focal_class.file: services/gateway/security/src/main/java/org/eclipse/ditto/services/gateway/security/authentication/AuthenticationChain.java
focal_class.identifier: AuthenticationChain
focal_class.class_method_signature: AuthenticationChain.AuthenticationChain(final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.full_signature: private  AuthenticationChain(final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.identifier: AuthenticationChain
focal_class.modifiers: private
focal_class.parameters: (final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.signature:  AuthenticationChain(final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.class_method_signature: AuthenticationChain.getInstance(final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.full_signature: public static AuthenticationChain getInstance(final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: (final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.return: AuthenticationChain
focal_class.signature: AuthenticationChain getInstance(final Collection<AuthenticationProvider<?>> authenticationProviders,
              final AuthenticationFailureAggregator authenticationFailureAggregator,
              final Executor authenticationDispatcher)
focal_class.class_method_signature: AuthenticationChain.authenticate(final RequestContext requestContext,
              final DittoHeaders dittoHeaders)
focal_class.full_signature: public CompletableFuture<AuthenticationResult> authenticate(final RequestContext requestContext,
              final DittoHeaders dittoHeaders)
focal_class.identifier: authenticate
focal_class.modifiers: public
focal_class.parameters: (final RequestContext requestContext,
              final DittoHeaders dittoHeaders)
focal_class.return: CompletableFuture<AuthenticationResult>
focal_class.signature: CompletableFuture<AuthenticationResult> authenticate(final RequestContext requestContext,
              final DittoHeaders dittoHeaders)
focal_class.class_method_signature: AuthenticationChain.doAuthenticate(final RequestContext requestContext, final DittoHeaders dittoHeaders)
focal_class.full_signature: private AuthenticationResult doAuthenticate(final RequestContext requestContext, final DittoHeaders dittoHeaders)
focal_class.identifier: doAuthenticate
focal_class.modifiers: private
focal_class.parameters: (final RequestContext requestContext, final DittoHeaders dittoHeaders)
focal_class.return: AuthenticationResult
focal_class.signature: AuthenticationResult doAuthenticate(final RequestContext requestContext, final DittoHeaders dittoHeaders)
focal_method.body: public CompletableFuture<AuthenticationResult> authenticate(final RequestContext requestContext,
              final DittoHeaders dittoHeaders) {
  
          return CompletableFuture
                  .runAsync(() -> LogUtil.enhanceLogWithCorrelationId(dittoHeaders), authenticationDispatcher)
                  .thenApply(voidValue -> doAuthenticate(requestContext, dittoHeaders));
      }
focal_method.class_method_signature: AuthenticationChain.authenticate(final RequestContext requestContext,
              final DittoHeaders dittoHeaders)
focal_method.full_signature: public CompletableFuture<AuthenticationResult> authenticate(final RequestContext requestContext,
              final DittoHeaders dittoHeaders)
focal_method.identifier: authenticate
focal_method.invocations: thenApply runAsync enhanceLogWithCorrelationId doAuthenticate
focal_method.modifiers: public
focal_method.parameters: (final RequestContext requestContext,
              final DittoHeaders dittoHeaders)
focal_method.return: CompletableFuture<AuthenticationResult>
focal_method.signature: CompletableFuture<AuthenticationResult> authenticate(final RequestContext requestContext,
              final DittoHeaders dittoHeaders)