# Spock tests grouping using @Category from junit

DevFeed: [Spock tests grouping using @Category from junit](<https://devfeed.tech/articles/spock-tests-grouping-using-category-from-junit-27265.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201701/spock-groups/>)

Published: 2017-01-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [RSpec](<https://devfeed.tech/topics/rspec.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [development](<https://devfeed.tech/tags/development.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [junit](<https://devfeed.tech/tags/junit.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

This tutorial explains how to group Spock tests with JUnit @Category and configure those groups in Gradle. It uses marker interfaces and a helper class to select which test groups run, allowing slower database tests to be skipped during unrelated development work.

## Source excerpt

When the project gets bigger and bigger there should be more and more tests. In the perfect world, all tests should be executed really fast, but life is far from perfect and sometimes some tests are slow. When using Gradle + Spock combination we have few ways of deciding how to group tests. I'm going to explore junit @Category in combination with Spock and grade. Read more