Access to test resources in Spring boot tests

To access to a resources test in spring boot tests, you can use the following statement :


You can also use the spring annotation TestPropertySource on your test class :

@TestPropertySource(locations = "resourcePath")
public class InputConfigurationTest {

Warning : Be careful about the resourcePath variable : this variable must start with a "/". For example : resourcePath = "/"

Next Post Previous Post