您应该使用@PropertySource或@TestPropertySource加载application-test.properties
@RunWith(SpringJUnit4ClassRunner.class)@TestPropertySource(locations="classpath:application-test.properties")@ContextConfiguration(classes = {WebTests.ConfigurationClass.class, WebTests.ClassToTest.class})public class WebTests {}


