更新时间:2022-04-10 23:58:11
您应该使用@PropertySource或@TestPropertySource加载application-test.properties
You should load the application-test.properties using @PropertySource or @TestPropertySource
@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource(locations="classpath:application-test.properties")
@ContextConfiguration(classes = {WebTests.ConfigurationClass.class, WebTests.ClassToTest.class})
public class WebTests {
}