Search code examples
javatestingjunitjunit4junit5

How to classify tests according to test sizes in JUnit


Given I have test sizes: small, medium and large as described in https://testing.googleblog.com/2010/12/test-sizes.html.

How can I classify all my tests according to test sizes?


Solution

  • You can use @org.junit.experimental.categories.Category with JUnit 4 or @org.junit.jupiter.api.Tag with JUnit Jupiter (a.k.a., the programming model for JUnit 5).