I have a configuration class as
@Configuration
@Getter
@Setter
@PropertySource(value = { "file:/config/appconfig.properties" })
public class ExternalProperties {
// varibles which get initize with @Value
}
which reads value from a file. But When I am trying to write integration test cases so at the time of initalization its failed as the appconfig.properties in present in the test env. And I am getting below error
Caused by: java.io.FileNotFoundException: /config/appconfig.properties (No such file or directory) at java.base/java.io.FileInputStream.open0(Native Method)
How to initizae the test enviroment in this case. what is the way we can point the PropertySouce to some other temp location?