Set offset when checking date in tests
Update integration tests that check the current date so that the offset is set for the current time before comparing results. See gh-34786
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user