src/main/java/de/gedoplan/seminar/sbt/di/exercise/SbtCoreExerciseApplication.java
@@ -2,7 +2,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; @ConfigurationPropertiesScan @SpringBootApplication public class SbtCoreExerciseApplication { src/main/java/de/gedoplan/seminar/sbt/di/exercise/rest/BarResource.java
@@ -35,7 +35,7 @@ @GetMapping(path = "name", produces = MediaType.TEXT_PLAIN_VALUE) public String getName() { return barInfo.getBarName(); return barInfo.barName(); } @GetMapping(path = "cocktails", produces = MediaType.APPLICATION_JSON_VALUE) src/main/java/de/gedoplan/seminar/sbt/di/exercise/service/BarInfo.java
@@ -1,11 +1,10 @@ package de.gedoplan.seminar.sbt.di.exercise.service; import org.springframework.stereotype.Component; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConstructorBinding; @Component public class BarInfo { @ConstructorBinding @ConfigurationProperties("bar-info") public record BarInfo(String barName) { public String getBarName() { return "Spring Boot Cocktail Bar"; } } src/main/resources/application.yaml
@@ -7,3 +7,6 @@ jpa: hibernate: ddl-auto: update barInfo: barName: Spring Boot Cocktail Bar