# Spock extensions

DevFeed: [Spock extensions](<https://devfeed.tech/articles/spock-extensions-27309.md>)

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

Published: 2019-07-11T00:00:00Z

Content type: tutorial

Language: en

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

Topics: [Framework](<https://devfeed.tech/topics/framework.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [Spring Boot](<https://devfeed.tech/topics/spring-boot.md>)

Tags: [extensions](<https://devfeed.tech/tags/extensions.md>), [framework](<https://devfeed.tech/tags/framework.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [spring-boot](<https://devfeed.tech/tags/spring-boot.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

A tutorial on creating a simple annotation-based Spock extension to execute additional logic before tests and change a toggle during test execution. It explains the extension annotation, implementation, interceptors, and lifecycle methods, with Spring Boot integration as context.

## Source excerpt

Recently I had to set up some extra logic to be executed before running tests. I had two options - create yet another abstract class with some behavior or somehow extend Spock and introduce extra logic to be executed just before actual test starts. As we already have enough of abstract classes I decided to try and do the second option. Read more