File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed
main/java/io/reflectoring/staticdata
test/java/io/reflectoring/staticdata Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change 33import org .springframework .boot .context .properties .ConfigurationProperties ;
44import org .springframework .stereotype .Component ;
55
6- import java .util .ArrayList ;
76import java .util .List ;
87
98@ Component
@@ -16,7 +15,7 @@ public QuotesProperties(List<Quote> quotes) {
1615 this .quotes = quotes ;
1716 }
1817
19- public List <Quote > getQuotes (){
18+ public List <Quote > getQuotes () {
2019 return this .quotes ;
2120 }
2221
Original file line number Diff line number Diff line change 33import org .junit .jupiter .api .Test ;
44import org .springframework .beans .factory .annotation .Autowired ;
55import org .springframework .boot .test .context .SpringBootTest ;
6- import org .springframework .test .context .TestPropertySource ;
76
87import static org .assertj .core .api .Assertions .assertThat ;
98
10- @ SpringBootTest
11- // @TestPropertySource cannot load YML files directly (using the "locations" attribute)
12- // so we simply tell Spring Boot to load the properties via spring.config.location.
13- @ TestPropertySource (properties = { "spring.config.location = file:./quotes.yml" })
9+ @ SpringBootTest (properties = {"spring.config.location = ./,file:./quotes.yml" })
1410class QuotesPropertiesTest {
1511
1612 @ Autowired
You can’t perform that action at this time.
0 commit comments