Suppose you have a large number of unit test cases and you don’t want them to be executed all at the same time during Maven build. You can simply achieve it via annotation @Category.
(1) Create empty class FastTests and SlowTests.
(2) In your test case class, categorize your test method using @Category annotation:
(3) Append the following code to your pom.xml: