您可以使用@TestPropertySource批注在测试期间伪造属性:
@ContextConfiguration @TestPropertySource(properties = { "timezOne= GMT", "port: 4242" }) public class MyIntegrationTests { // class body... }