File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
webauthn-server-attestation/src/test/scala/com/yubico/fido/metadata Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,7 @@ class FidoMetadataDownloaderSpec
410
410
}
411
411
412
412
it(
413
- " The trust root is not downloaded if there's a valid one in file cache."
413
+ " The trust root is not downloaded and not written to cache if there's a valid one in file cache."
414
414
) {
415
415
val random = new SecureRandom ()
416
416
val trustRootDistinguishedName =
@@ -438,6 +438,10 @@ class FidoMetadataDownloaderSpec
438
438
f.write(trustRootCert.getEncoded)
439
439
f.close()
440
440
cacheFile.deleteOnExit()
441
+ cacheFile.setLastModified(
442
+ cacheFile.lastModified() - 1000
443
+ ) // Set mtime in the past to ensure any write will change it
444
+ val initialModTime = cacheFile.lastModified
441
445
442
446
val blob = load(
443
447
FidoMetadataDownloader
@@ -456,6 +460,7 @@ class FidoMetadataDownloaderSpec
456
460
blob.getHeader.getX5c.get.asScala.last.getIssuerDN.getName should equal(
457
461
trustRootDistinguishedName
458
462
)
463
+ cacheFile.lastModified should equal(initialModTime)
459
464
}
460
465
461
466
it(
You can’t perform that action at this time.
0 commit comments