mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 01:58:16 +08:00
Prepare for Spring Boot 1.5 compatibility
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-redis</artifactId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,9 @@ import org.junit.Test
|
||||
|
||||
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean
|
||||
import org.springframework.boot.bind.PropertiesConfigurationFactory
|
||||
import org.springframework.core.env.MutablePropertySources
|
||||
import org.springframework.core.env.PropertiesPropertySource
|
||||
import org.springframework.core.env.PropertySources
|
||||
import org.springframework.core.io.ClassPathResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
@@ -183,7 +186,9 @@ class InitializrMetadataBuilderTests {
|
||||
PropertiesConfigurationFactory<InitializrProperties> factory =
|
||||
new PropertiesConfigurationFactory<>(InitializrProperties)
|
||||
factory.setTargetName("initializr")
|
||||
factory.setProperties(loadProperties(resource))
|
||||
PropertySources sources = new MutablePropertySources()
|
||||
sources.addFirst(new PropertiesPropertySource("main", loadProperties(resource)))
|
||||
factory.setPropertySources(sources)
|
||||
factory.afterPropertiesSet();
|
||||
return factory.getObject();
|
||||
}
|
||||
|
Reference in New Issue
Block a user