Skip to content

Commit

Permalink
[SELC-4950] Removed unused fields from test
Browse files Browse the repository at this point in the history
  • Loading branch information
flaminiaScarciofolo committed Jun 7, 2024
1 parent 7b3d38f commit 4d29888
Showing 1 changed file with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ void exchange_noInstitutionInfo() throws Exception {
// given
String institutionId = "institutionId";
String productId = "productId";
String jti = "id";
String sub = "subject";
Date iat = Date.from(Instant.now().minusSeconds(1));
Date exp = Date.from(iat.toInstant().plusSeconds(5));
File file = ResourceUtils.getFile("classpath:certs/PKCS8key.pem");
String jwtSigningKey = Files.readString(file.toPath(), Charset.defaultCharset());
ExchangeTokenProperties properties = new ExchangeTokenProperties();
Expand Down Expand Up @@ -591,7 +587,6 @@ void exchange_ok(PrivateKey privateKey) throws Exception {
final ExchangedToken exchangedToken = ExchangeTokenServiceV2.exchange(institutionId, productId, Optional.empty());
// then
assertEquals(product.getUrlBO(), exchangedToken.getBackOfficeUrl());
assertNotNull(exchangedToken.getIdentityToken());
Jws<Claims> claimsJws = Jwts.parser()
.setSigningKey(loadPublicKey())
.parseClaimsJws(exchangedToken.getIdentityToken());
Expand All @@ -604,9 +599,6 @@ void exchange_ok(PrivateKey privateKey) throws Exception {
assertEquals(userId.toString(), exchangedClaims.getSubject());
assertEquals(issuer, exchangedClaims.getIssuer());
assertEquals(realm, exchangedClaims.getAudience());
// https://github.com/jwtk/jjwt/issues/122:
// The JWT RFC *mandates* NumericDate values are represented as seconds.
// Because java.util.Date requires milliseconds, we need to multiply by 1000:
assertEquals(exp.toInstant().getEpochSecond(), exchangedClaims.getDesiredExpiration().toInstant().getEpochSecond());
assertTrue(exchangedClaims.getIssuedAt().after(iat));
assertTrue(exchangedClaims.getExpiration().after(exp));
Expand Down

0 comments on commit 4d29888

Please sign in to comment.