What is the equivalent of ExternalResource and TemporaryFolder in JUnit 5?

后端 未结 5 2405
心在旅途
心在旅途 2021-02-19 02:20

According to the JUnit 5 User Guide, JUnit Jupiter provides backwards compatibility for some JUnit 4 Rules in order to assist with migration.

As stated ab

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-19 03:07

    Interesting article by author of TemporaryFolderExtension for JUnit5

    and

    his code repo on github

    JUnit5.0.0 is now in general release so let's hope they turn their attention to making the experimental stuff production-ready.

    Meanwhile, it seems the TemporaryFolder rule will still work with JUnit5 docs

    use this:

    @EnableRuleMigrationSupport
    public class MyJUnit5Test {
    

    and this:

    
        org.junit.jupiter
        junit-jupiter-migrationsupport
        5.0.0
    
    

提交回复
热议问题