Browse Source

Use millisecond precision for build time in BuildPropertiesTests

Closes gh-12420
pull/12419/merge
Andy Wilkinson 8 years ago
parent
commit
9b637d4f0d
  1. 4
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/info/BuildPropertiesTests.java

4
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/info/BuildPropertiesTests.java

@ -18,6 +18,7 @@ package org.springframework.boot.info; @@ -18,6 +18,7 @@ package org.springframework.boot.info;
import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Properties;
import org.junit.Test;
@ -39,7 +40,8 @@ public class BuildPropertiesTests { @@ -39,7 +40,8 @@ public class BuildPropertiesTests {
assertThat(properties.getGroup()).isEqualTo("com.example");
assertThat(properties.getArtifact()).isEqualTo("demo");
assertThat(properties.getVersion()).isEqualTo("0.0.1");
assertThat(properties.getTime()).isEqualTo(instant);
assertThat(properties.getTime())
.isEqualTo(instant.truncatedTo(ChronoUnit.MILLIS));
assertThat(properties.get("time"))
.isEqualTo(String.valueOf(instant.toEpochMilli()));
}

Loading…
Cancel
Save