@Test void givenNoToken_whenCreateCommand_thenDontAddZuulHeader() { when(authenticationService.getJwtTokenFromRequest(request)).thenReturn(Optional.empty()); zosmfScheme.createCommand(authentication, () -> queryResponse).apply(null); verify(requestContext, never()).addZuulRequestHeader(anyString(), anyString()); }
@Override public AuthenticationCommand createCommand(Authentication authentication, Supplier<QueryResponse> tokenSupplier) { final QueryResponse queryResponse = tokenSupplier.get(); final Date expiration = queryResponse == null ? null : queryResponse.getExpiration(); final Long expirationTime = expiration == null ? null : expiration.getTime(); return new ZosmfCommand(expirationTime); }
ZosmfScheme implements AbstractAuthenticationScheme { @Override public AuthenticationCommand createCommand(Authentication authentication, Supplier<QueryResponse> tokenSupplier) { final QueryResponse queryResponse = tokenSupplier.get(); final Date expiration = queryResponse == null ? null : queryResponse.getExpiration(); final Long expirationTime = expiration == null ? null : expiration.getTime(); return new ZosmfCommand(expirationTime); } }
ZosmfScheme implements AbstractAuthenticationScheme { @Override public AuthenticationCommand createCommand(Authentication authentication, Supplier<QueryResponse> tokenSupplier) { final QueryResponse queryResponse = tokenSupplier.get(); final Date expiration = queryResponse == null ? null : queryResponse.getExpiration(); final Long expirationTime = expiration == null ? null : expiration.getTime(); return new ZosmfCommand(expirationTime); }  }
ZosmfScheme implements AbstractAuthenticationScheme { @Override public AuthenticationCommand createCommand(Authentication authentication, Supplier<QueryResponse> tokenSupplier) { final QueryResponse queryResponse = tokenSupplier.get(); final Date expiration = queryResponse == null ? null : queryResponse.getExpiration(); final Long expirationTime = expiration == null ? null : expiration.getTime(); return new ZosmfCommand(expirationTime); }  @Override AuthenticationScheme getScheme(); @Override AuthenticationCommand createCommand(Authentication authentication, Supplier<QueryResponse> tokenSupplier); }
ZosmfScheme implements AbstractAuthenticationScheme { @Override public AuthenticationCommand createCommand(Authentication authentication, Supplier<QueryResponse> tokenSupplier) { final QueryResponse queryResponse = tokenSupplier.get(); final Date expiration = queryResponse == null ? null : queryResponse.getExpiration(); final Long expirationTime = expiration == null ? null : expiration.getTime(); return new ZosmfCommand(expirationTime); }  @Override AuthenticationScheme getScheme(); @Override AuthenticationCommand createCommand(Authentication authentication, Supplier<QueryResponse> tokenSupplier);  }