|
|
@ -16,6 +16,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.info;
|
|
|
|
package org.springframework.boot.info;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.Instant;
|
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.Properties;
|
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
@ -31,14 +33,15 @@ public class BuildPropertiesTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void basicInfo() {
|
|
|
|
public void basicInfo() {
|
|
|
|
|
|
|
|
Instant instant = Instant.now();
|
|
|
|
BuildProperties properties = new BuildProperties(createProperties("com.example",
|
|
|
|
BuildProperties properties = new BuildProperties(createProperties("com.example",
|
|
|
|
"demo", "0.0.1", "2016-03-04T14:36:33+0100"));
|
|
|
|
"demo", "0.0.1", DateTimeFormatter.ISO_INSTANT.format(instant)));
|
|
|
|
assertThat(properties.getGroup()).isEqualTo("com.example");
|
|
|
|
assertThat(properties.getGroup()).isEqualTo("com.example");
|
|
|
|
assertThat(properties.getArtifact()).isEqualTo("demo");
|
|
|
|
assertThat(properties.getArtifact()).isEqualTo("demo");
|
|
|
|
assertThat(properties.getVersion()).isEqualTo("0.0.1");
|
|
|
|
assertThat(properties.getVersion()).isEqualTo("0.0.1");
|
|
|
|
assertThat(properties.getTime()).isNotNull();
|
|
|
|
assertThat(properties.getTime()).isEqualTo(instant);
|
|
|
|
assertThat(properties.get("time")).isEqualTo("1457098593000");
|
|
|
|
assertThat(properties.get("time"))
|
|
|
|
assertThat(properties.getTime().toEpochMilli()).isEqualTo(1457098593000L);
|
|
|
|
.isEqualTo(String.valueOf(instant.toEpochMilli()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|