@Test public void resolveCallsTokenResolver() { IdentityTokenResolver tokenResolver = mock(IdentityTokenResolver.class); when(httpCommand.getIdentityTokenResolver()).thenReturn(tokenResolver); List<IdentityToken> tokens = Arrays.asList(new IdentityToken("SomeToken","SomeValue")); when(tokenResolver.resolve(request, null)).thenReturn(tokens); identityTokenResolver.resolve(httpCommand, null, builder); verify(tokenResolver, times(1)).resolve(request, null); assertEquals(tokens, builder.getIdentityTokens()); }
@Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } HttpIdentityTokenResolver(); }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } HttpIdentityTokenResolver(); @Override void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder); }
HttpIdentityTokenResolver extends X509IdentityTokenResolver<HttpCommand, Ignore> { @Override public void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder) { List<IdentityToken> tokens = new ArrayList<>(); if (httpCommand.getIdentityTokenResolver() != null) { X509Certificate[] certificateChain = resolveCertificates(httpCommand.getRequest()); tokens = httpCommand.getIdentityTokenResolver().resolve(httpCommand.getRequest(), certificateChain); } builder.setIdentityTokens(tokens); } HttpIdentityTokenResolver(); @Override void resolve(HttpCommand httpCommand, Ignore ignore, DehydratedExecutionContextBuilder builder);  }