@Test public void certificatesObtained() { IdentityTokenResolver tokenResolver = mock(IdentityTokenResolver.class); when(httpCommand.getIdentityTokenResolver()).thenReturn(tokenResolver); X509Certificate cert = mock(X509Certificate.class); X509Certificate[] certs = new X509Certificate[] { cert }; when(request.getAttribute(X509IdentityTokenResolver.CERTIFICATE_ATTRIBUTE_NAME)).thenReturn(certs); when(tokenResolver.resolve(credsContainer, certs)).thenReturn(new ArrayList<>()); identityTokenResolver.resolve(httpCommand, credsContainer, builder); verify(tokenResolver, times(1)).resolve(credsContainer, certs); }
@Override public void resolve(HttpCommand httpCommand, OMElement omElement, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(omElement, certificateChain); } builder.setIdentityTokens(tokens); }
SoapIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, OMElement> { @Override public void resolve(HttpCommand httpCommand, OMElement omElement, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(omElement, certificateChain); } builder.setIdentityTokens(tokens); } }
SoapIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, OMElement> { @Override public void resolve(HttpCommand httpCommand, OMElement omElement, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(omElement, certificateChain); } builder.setIdentityTokens(tokens); } SoapIdentityTokenResolver(); }
SoapIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, OMElement> { @Override public void resolve(HttpCommand httpCommand, OMElement omElement, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(omElement, certificateChain); } builder.setIdentityTokens(tokens); } SoapIdentityTokenResolver(); @Override void resolve(HttpCommand httpCommand, OMElement omElement, DehydratedExecutionContextBuilder builder); }
SoapIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, OMElement> { @Override public void resolve(HttpCommand httpCommand, OMElement omElement, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(omElement, certificateChain); } builder.setIdentityTokens(tokens); } SoapIdentityTokenResolver(); @Override void resolve(HttpCommand httpCommand, OMElement omElement, DehydratedExecutionContextBuilder builder);  }