Java @方法级别上的TestPropertySource注释替代方案

Java @方法级别上的TestPropertySource注释替代方案,java,spring,testing,annotations,spring-test,Java,Spring,Testing,Annotations,Spring Test,是否有在方法中使用测试实例属性的替代方法 @TestPropertySource(locations="classpath:test.properties") public class Aclass {} 这仍然是不可能的,但如果您希望遵循此功能,则有一个解决方案 @Test public void aMethod(){}

是否有在方法中使用测试实例属性的替代方法

@TestPropertySource(locations="classpath:test.properties")
public class Aclass {}

这仍然是不可能的,但如果您希望遵循此功能,则有一个解决方案

@Test
public void aMethod(){}