@Test void givenTokenThatWillExpireInOneSec_whenCreateCommand_thenTestCommandExpiration() { QueryResponse queryResponse = prepareQueryResponseForTime(2); AuthenticationCommand command = scheme.createCommand(null, () -> queryResponse); assertFalse(command.isExpired()); }
@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);  }