diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java index 3bd9edf96d..97bf53cc31 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java @@ -322,7 +322,7 @@ class BootBuildImageIntegrationTests { assertThat(result.getOutput()).contains("---> Test Info buildpack done"); Image image = new DockerApi().image().inspect(ImageReference.of("docker.io/library/" + projectName)); OffsetDateTime createdDateTime = OffsetDateTime.parse(image.getCreated()); - OffsetDateTime current = OffsetDateTime.now(); + OffsetDateTime current = OffsetDateTime.now().withOffsetSameInstant(createdDateTime.getOffset()); assertThat(createdDateTime.getYear()).isEqualTo(current.getYear()); assertThat(createdDateTime.getMonth()).isEqualTo(current.getMonth()); assertThat(createdDateTime.getDayOfMonth()).isEqualTo(current.getDayOfMonth()); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java index 546134c112..2b67f1035e 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java @@ -427,7 +427,7 @@ class BuildImageTests extends AbstractArchiveIntegrationTests { .inspect(ImageReference .of("docker.io/library/build-image-current-created-date:0.0.1.BUILD-SNAPSHOT")); OffsetDateTime createdDateTime = OffsetDateTime.parse(image.getCreated()); - OffsetDateTime current = OffsetDateTime.now(); + OffsetDateTime current = OffsetDateTime.now().withOffsetSameInstant(createdDateTime.getOffset()); assertThat(createdDateTime.getYear()).isEqualTo(current.getYear()); assertThat(createdDateTime.getMonth()).isEqualTo(current.getMonth()); assertThat(createdDateTime.getDayOfMonth()).isEqualTo(current.getDayOfMonth());