Search in sources :

Example 1 with BuildProperties

use of org.springframework.boot.info.BuildProperties in project spring-boot by spring-projects.

the class ProjectInfoAutoConfigurationTests method buildPropertiesFallbackWithBuildInfoBean.

@Test
public void buildPropertiesFallbackWithBuildInfoBean() {
    load(CustomInfoPropertiesConfiguration.class);
    BuildProperties buildProperties = this.context.getBean(BuildProperties.class);
    assertThat(buildProperties).isSameAs(this.context.getBean("customBuildProperties"));
}
Also used : BuildProperties(org.springframework.boot.info.BuildProperties) Test(org.junit.Test)

Example 2 with BuildProperties

use of org.springframework.boot.info.BuildProperties in project spring-boot by spring-projects.

the class ProjectInfoAutoConfigurationTests method buildPropertiesCustomLocation.

@Test
public void buildPropertiesCustomLocation() {
    load("spring.info.build.location=classpath:/org/springframework/boot/autoconfigure/info/build-info.properties");
    BuildProperties buildProperties = this.context.getBean(BuildProperties.class);
    assertThat(buildProperties.getGroup()).isEqualTo("com.example.acme");
    assertThat(buildProperties.getArtifact()).isEqualTo("acme");
    assertThat(buildProperties.getName()).isEqualTo("acme");
    assertThat(buildProperties.getVersion()).isEqualTo("1.0.1-SNAPSHOT");
    assertThat(buildProperties.getTime().getTime()).isEqualTo(1457088120000L);
}
Also used : BuildProperties(org.springframework.boot.info.BuildProperties) Test(org.junit.Test)

Example 3 with BuildProperties

use of org.springframework.boot.info.BuildProperties in project spring-boot by spring-projects.

the class ProjectInfoAutoConfigurationTests method buildPropertiesDefaultLocation.

@Test
public void buildPropertiesDefaultLocation() {
    load();
    BuildProperties buildProperties = this.context.getBean(BuildProperties.class);
    assertThat(buildProperties.getGroup()).isEqualTo("com.example");
    assertThat(buildProperties.getArtifact()).isEqualTo("demo");
    assertThat(buildProperties.getName()).isEqualTo("Demo Project");
    assertThat(buildProperties.getVersion()).isEqualTo("0.0.1-SNAPSHOT");
    assertThat(buildProperties.getTime().getTime()).isEqualTo(1457100965000L);
}
Also used : BuildProperties(org.springframework.boot.info.BuildProperties) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 BuildProperties (org.springframework.boot.info.BuildProperties)3