use of org.keycloak.testsuite.webauthn.authenticators.KcVirtualAuthenticator in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method addVirtualAuthenticator.
@Test
public void addVirtualAuthenticator() {
final VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(driver);
assertThat(manager, notNullValue());
KcVirtualAuthenticator authenticator = useDefaultTestingAuthenticator(manager);
assertAuthenticatorOptions(authenticator);
manager.removeAuthenticator();
assertThat(manager.getCurrent(), Matchers.nullValue());
authenticator = useDefaultTestingAuthenticator(manager);
assertAuthenticatorOptions(authenticator);
manager.removeAuthenticator();
assertThat(manager.getCurrent(), Matchers.nullValue());
}
use of org.keycloak.testsuite.webauthn.authenticators.KcVirtualAuthenticator in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method differentDriver.
@Test
public void differentDriver() {
final VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(driver);
assertThat(manager, notNullValue());
KcVirtualAuthenticator authenticator = useDefaultTestingAuthenticator(manager);
assertThat(authenticator, notNullValue());
assertThat(manager.getCurrent(), notNullValue());
final VirtualAuthenticatorManager manager2 = new VirtualAuthenticatorManager(driver2);
assertThat(manager2, notNullValue());
assertThat(manager2.getCurrent(), nullValue());
}
use of org.keycloak.testsuite.webauthn.authenticators.KcVirtualAuthenticator in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method overrideUsedAuthenticator.
@Test
public void overrideUsedAuthenticator() {
final VirtualAuthenticatorManager manager = new VirtualAuthenticatorManager(driver);
assertThat(manager, notNullValue());
KcVirtualAuthenticator defaultTesting = useDefaultTestingAuthenticator(manager);
assertAuthenticatorOptions(defaultTesting);
assertThat(manager.getCurrent(), is(defaultTesting));
VirtualAuthenticatorOptions defaultBleOptions = DefaultVirtualAuthOptions.DEFAULT_BLE.getOptions();
assertThat(defaultBleOptions, notNullValue());
KcVirtualAuthenticator defaultBLE = manager.useAuthenticator(defaultBleOptions);
assertThat(defaultBLE, notNullValue());
assertAuthenticatorOptions(defaultTesting);
assertThat(manager.getCurrent(), is(defaultBLE));
assertThat(manager.getCurrent().getOptions().clone(), is(defaultBleOptions));
}
use of org.keycloak.testsuite.webauthn.authenticators.KcVirtualAuthenticator in project keycloak by keycloak.
the class VirtualAuthenticatorsManagerTest method useDefaultTestingAuthenticator.
private static KcVirtualAuthenticator useDefaultTestingAuthenticator(VirtualAuthenticatorManager manager) {
KcVirtualAuthenticator authenticator = manager.useAuthenticator(defaultTestingAuthenticatorOptions());
assertThat(authenticator, notNullValue());
assertThat(manager.getCurrent(), is(authenticator));
return authenticator;
}
Aggregations