Java 类org.springframework.boot.info.BuildProperties 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:InfoContributorAutoConfiguration.java   
@Bean
@ConditionalOnEnabledInfoContributor("build")
@ConditionalOnSingleCandidate(BuildProperties.class)
@Order(DEFAULT_ORDER)
public InfoContributor buildInfoContributor(BuildProperties buildProperties) {
    return new BuildInfoContributor(buildProperties);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:InfoContributorAutoConfigurationTests.java   
@Bean
public BuildProperties buildProperties() {
    Properties properties = new Properties();
    properties.put("group", "com.example");
    properties.put("artifact", "demo");
    properties.put("foo", "bar");
    return new BuildProperties(properties);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ProjectInfoAutoConfiguration.java   
@ConditionalOnResource(resources = "${spring.info.build.location:classpath:META-INF/build-info.properties}")
@ConditionalOnMissingBean
@Bean
public BuildProperties buildProperties() throws Exception {
    return new BuildProperties(
            loadFrom(this.properties.getBuild().getLocation(), "build"));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ProjectInfoAutoConfigurationTests.java   
@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);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ProjectInfoAutoConfigurationTests.java   
@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);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ProjectInfoAutoConfigurationTests.java   
@Test
public void buildPropertiesCustomInvalidLocation() {
    load("spring.info.build.location=classpath:/org/acme/no-build-info.properties");
    Map<String, BuildProperties> beans = this.context
            .getBeansOfType(BuildProperties.class);
    assertThat(beans).hasSize(0);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ProjectInfoAutoConfigurationTests.java   
@Test
public void buildPropertiesFallbackWithBuildInfoBean() {
    load(CustomInfoPropertiesConfiguration.class);
    BuildProperties buildProperties = this.context.getBean(BuildProperties.class);
    assertThat(buildProperties)
            .isSameAs(this.context.getBean("customBuildProperties"));
}
项目:spring-boot-concourse    文件:InfoContributorAutoConfiguration.java   
@Bean
@ConditionalOnEnabledInfoContributor("build")
@ConditionalOnSingleCandidate(BuildProperties.class)
@Order(DEFAULT_ORDER)
public InfoContributor buildInfoContributor(BuildProperties buildProperties) {
    return new BuildInfoContributor(buildProperties);
}
项目:spring-boot-concourse    文件:InfoContributorAutoConfigurationTests.java   
@Bean
public BuildProperties buildProperties() {
    Properties properties = new Properties();
    properties.put("group", "com.example");
    properties.put("artifact", "demo");
    properties.put("foo", "bar");
    return new BuildProperties(properties);
}
项目:spring-boot-concourse    文件:ProjectInfoAutoConfiguration.java   
@ConditionalOnResource(resources = "${spring.info.build.location:classpath:META-INF/build-info.properties}")
@ConditionalOnMissingBean
@Bean
public BuildProperties buildProperties() throws Exception {
    return new BuildProperties(
            loadFrom(this.properties.getBuild().getLocation(), "build"));
}
项目:spring-boot-concourse    文件:ProjectInfoAutoConfigurationTests.java   
@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);
}
项目:spring-boot-concourse    文件:ProjectInfoAutoConfigurationTests.java   
@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);
}
项目:spring-boot-concourse    文件:ProjectInfoAutoConfigurationTests.java   
@Test
public void buildPropertiesCustomInvalidLocation() {
    load("spring.info.build.location=classpath:/org/acme/no-build-info.properties");
    Map<String, BuildProperties> beans = this.context
            .getBeansOfType(BuildProperties.class);
    assertThat(beans).hasSize(0);
}
项目:spring-boot-concourse    文件:ProjectInfoAutoConfigurationTests.java   
@Test
public void buildPropertiesFallbackWithBuildInfoBean() {
    load(CustomInfoPropertiesConfiguration.class);
    BuildProperties buildProperties = this.context.getBean(BuildProperties.class);
    assertThat(buildProperties)
            .isSameAs(this.context.getBean("customBuildProperties"));
}
项目:sentry    文件:Info.java   
@Autowired
public Info(PermissionService permissionService, BuildProperties buildProperties, RestTemplate restTemplate) {
    this.permissionService = permissionService;
    this.buildProperties = buildProperties;
    this.restTemplate = restTemplate;
}
项目:sentry    文件:Info.java   
@Autowired
public Info(PermissionService permissionService, BuildProperties buildProperties, RestTemplate restTemplate) {
    this.permissionService = permissionService;
    this.buildProperties = buildProperties;
    this.restTemplate = restTemplate;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:BuildInfoContributor.java   
public BuildInfoContributor(BuildProperties properties) {
    super(properties, Mode.FULL);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:InfoContributorAutoConfigurationTests.java   
@Bean
public BuildInfoContributor customBuildInfoContributor() {
    return new BuildInfoContributor(new BuildProperties(new Properties()));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ProjectInfoAutoConfigurationTests.java   
@Bean
public BuildProperties customBuildProperties() {
    return new BuildProperties(new Properties());
}
项目:spring-boot-concourse    文件:BuildInfoContributor.java   
public BuildInfoContributor(BuildProperties properties) {
    super(properties, Mode.FULL);
}
项目:spring-boot-concourse    文件:InfoContributorAutoConfigurationTests.java   
@Bean
public BuildInfoContributor customBuildInfoContributor() {
    return new BuildInfoContributor(new BuildProperties(new Properties()));
}
项目:spring-boot-concourse    文件:ProjectInfoAutoConfigurationTests.java   
@Bean
public BuildProperties customBuildProperties() {
    return new BuildProperties(new Properties());
}
项目:holdmail    文件:BuildInfoMapper.java   
public BuildInfo fromProperties(BuildProperties properties) {

        return new BuildInfo(properties.getVersion(), properties.getTime());
    }