1
@TestPropertySource(locations="classpath:test.properties")
public class Aclass {}
是否有替代方法使用方法中測試實例的屬性。方法級別上的@TestPropertySource註釋替代方法
@Test
public void aMethod(){}
@TestPropertySource(locations="classpath:test.properties")
public class Aclass {}
是否有替代方法使用方法中測試實例的屬性。方法級別上的@TestPropertySource註釋替代方法
@Test
public void aMethod(){}
例如使用元數據註解
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) //triggering used in method.
@TestPropertySource(locations="classpath:test.properties")
@Test
public @interface testbase{}
,並使用
@testbase
public void aMethod(){}
10X我會把它和復出檢查你 – kidwon
沒有不工作,test.properties不能在aMethod()中讀取 – tfeiner