Skip to content

Commit 05172cf

Browse files
committed
Use ZipEntryConstants.CONSTANT_TIME_FOR_ZIP_ENTRIES to check timestamp
Update `AbstractBootArchiveTests` to use the Gradle provided constant to check the repeatable timestamp.
1 parent 4420c92 commit 05172cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ void archiveIsReproducibleByDefault() throws IOException {
420420
Enumeration<JarEntry> entries = jarFile.entries();
421421
while (entries.hasMoreElements()) {
422422
JarEntry entry = entries.nextElement();
423-
OffsetDateTime lastModifiedTime = entry.getLastModifiedTime().toInstant().atOffset(ZoneOffset.UTC);
424-
assertThat(lastModifiedTime).isEqualTo(OffsetDateTime.of(1980, 2, 1, 0, 0, 0, 0, ZoneOffset.UTC));
423+
assertThat(entry.getLastModifiedTime().toMillis())
424+
.isEqualTo(ZipEntryConstants.CONSTANT_TIME_FOR_ZIP_ENTRIES);
425425
if (entry.getName().startsWith("files/")) {
426426
files.add(entry.getName());
427427
}

0 commit comments

Comments
 (0)