@Test void givenRequestWithNoCookie_whenApplyToRequest_thenAppendSetCookie() { HttpRequest httpRequest = new HttpGet("/test/request"); prepareAuthenticationService("ltpa1"); zosmfScheme.createCommand(authentication, () -> queryResponse).applyToRequest(httpRequest); assertEquals("LtpaToken2=ltpa1", httpRequest.getFirstHeader("cookie").getValue()); }
@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);  }