mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Align simple sample with configuration properties validation change
See gh-8024
This commit is contained in:
parent
852ad093b2
commit
622e65a290
@ -20,7 +20,9 @@ import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@Validated
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "sample")
|
||||
public class SampleConfigurationProperties {
|
||||
|
@ -58,10 +58,6 @@ public class SampleSimpleApplicationTests {
|
||||
SampleSimpleApplication.main(new String[0]);
|
||||
String output = this.outputCapture.toString();
|
||||
assertThat(output).contains("Hello Phil");
|
||||
assertThat(output).contains("The @ConfigurationProperties bean class "
|
||||
+ "sample.simple.SampleConfigurationProperties contains "
|
||||
+ "validation constraints but had not been annotated "
|
||||
+ "with @Validated");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user