use of org.codice.ddf.cxf.client.impl.SecureCxfClientFactoryImpl.AliasSelectorKeyManager in project ddf by codice.
the class SecureCxfClientFactoryTest method testAliasSelectorKeyManager.
@Test
public void testAliasSelectorKeyManager() {
X509KeyManager keyManager = mock(X509KeyManager.class);
String alias = "testAlias";
String[] aliases = new String[] { alias };
when(keyManager.chooseClientAlias(any(), any(), any())).thenReturn(alias);
when(keyManager.getClientAliases(any(), any())).thenReturn(aliases);
AliasSelectorKeyManager aliasSelectorKeyManager = new AliasSelectorKeyManager(keyManager, alias);
String chosenAlias = aliasSelectorKeyManager.chooseClientAlias(new String[] { "x509" }, null, null);
assertThat(chosenAlias, is(alias));
}
Aggregations