use of io.gravitee.gateway.security.core.HookAuthenticationPolicy in project gravitee-gateway by gravitee-io.
the class JWTAuthenticationHandlerTest method shouldReturnPolicies.
@Test
public void shouldReturnPolicies() {
ExecutionContext executionContext = mock(ExecutionContext.class);
List<AuthenticationPolicy> jwtProviderPolicies = authenticationHandler.handle(executionContext);
Assert.assertEquals(2, jwtProviderPolicies.size());
Iterator<AuthenticationPolicy> policyIte = jwtProviderPolicies.iterator();
PluginAuthenticationPolicy policy = (PluginAuthenticationPolicy) policyIte.next();
Assert.assertEquals(JWTAuthenticationHandler.AUTHENTICATION_HANDLER_NAME, policy.name());
HookAuthenticationPolicy policy2 = (HookAuthenticationPolicy) policyIte.next();
Assert.assertEquals(CheckSubscriptionPolicy.class, policy2.clazz());
}
use of io.gravitee.gateway.security.core.HookAuthenticationPolicy in project gravitee-gateway by gravitee-io.
the class OAuth2AuthenticationHandlerTest method shouldReturnPolicies.
@Test
public void shouldReturnPolicies() {
ExecutionContext executionContext = mock(ExecutionContext.class);
List<AuthenticationPolicy> oauth2ProviderPolicies = authenticationHandler.handle(executionContext);
Assert.assertEquals(2, oauth2ProviderPolicies.size());
Iterator<AuthenticationPolicy> policyIte = oauth2ProviderPolicies.iterator();
PluginAuthenticationPolicy policy = (PluginAuthenticationPolicy) policyIte.next();
Assert.assertEquals(OAuth2AuthenticationHandler.AUTHENTICATION_HANDLER_NAME, policy.name());
HookAuthenticationPolicy policy2 = (HookAuthenticationPolicy) policyIte.next();
Assert.assertEquals(CheckSubscriptionPolicy.class, policy2.clazz());
}
Aggregations