首页 > 解决方案 > 如何根据 JUnit 中的测试大小对测试进行分类

问题描述

鉴于我有测试尺寸:如https://testing.googleblog.com/2010/12/test-sizes.html中所述的smallmediumlarge

如何根据测试大小对所有测试进行分类?

标签: javatestingjunitjunit4junit5

解决方案


您可以使用@org.junit.experimental.categories.CategoryJUnit 4 或@org.junit.jupiter.api.TagJUnit Jupiter(又名 JUnit 5 的编程模型)。


推荐阅读