In product code, I can use the following code to read the aws.default.region
property from
application.properties
and application-development.properties
@Value("${aws.default.region:null}")
private String awsDefaultRegion;
However, in unit test the same code doesn't work, and awsDefaultRegion
variable is always null.
I tried to add the following annotation but it doesn't work.
@PropertySource({
"classpath:application.properties",
"classpath:application-development.properties"
})