junit測試方法按順序執行

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = ThirdPlatformBootStrap.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)  // 方法首字母順序執行測試
public class MsjTest {
    
    @Test
    public void Atest(){
        // process...
    }

    @Test
    public void Btest(){
        // process...
    }

    @Test
     public void Ctest(){
        // 
    }
}
相關文章
相關標籤/搜索