jeudi 29 août 2019

SpringBoot unit test cannot load yaml file

when i try to test springboot program, it cannot find application.yaml file.but when i change it to application.properties, it work well.

I tried a lot of methods and couldn't solve the problem very well.It seems that there is only one solution, that is to use the .properties file.

The testCode :

@RunWith(SpringRunner.class)
@SpringBootTest
public class VizServerApplicationTests {

    @Test
    public void contextLoads() {
    }
}

Error Message:

    Could not resolve placeholder 'spring.datasource.url' in value 
    "${spring.datasource.url}"

Aucun commentaire:

Enregistrer un commentaire