{"id":54793,"library":"spock-spring","title":"Spock Spring","description":"Spock's Spring Module integrates Spring's TestContext framework with Spock for testing Spring applications.","status":"active","version":"2.4-groovy-3.0","language":"java","source_language":null,"source_url":"https://github.com/spockframework/spock","tags":["spock","spring","testing","groovy"],"install":[{"cmd":"<dependency>\n  <groupId>org.spockframework</groupId>\n  <artifactId>spock-spring</artifactId>\n  <version>2.4-groovy-3.0</version>\n</dependency>","lang":"xml","label":"Maven"},{"cmd":"implementation 'org.spockframework:spock-spring:2.4-groovy-3.0'","lang":"groovy","label":"Gradle"}],"dependencies":[],"imports":[{"symbol":"SpringBean","correct":"org.spockframework.spring.SpringBean"}],"quickstart":{"code":"import org.spockframework.spring.SpringBean\nimport spock.lang.Specification\n\nclass MyServiceSpec extends Specification {\n    @SpringBean\n    MyService myService = new MyService()\n\n    def \"test service\"() {\n        expect:\n        myService.doSomething() == \"result\"\n    }\n}","lang":"groovy","description":"Use SpringBean to inject a Spring bean into a Spock specification."},"warnings":[{"fix":"Use Spock 1.x for Groovy 2.x or upgrade to Groovy 3.x.","message":"Spock 2.x requires Groovy 3.x; older Groovy versions are incompatible.","severity":"breaking","affected_versions":">=2.0"}],"env_vars":null,"search_vec":"'applic':17 'framework':11 'groovi':21 'integr':7 'modul':6 'spock':1,3,13,18 'spring':2,5,8,16,19 'test':15,20 'testcontext':10","created_at":"2026-06-15T09:23:34.912653+00:00","updated_at":"2026-06-15T09:23:34.912653+00:00","problems":[],"ecosystem":"maven","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://spockframework.org","github":"https://github.com/spockframework/spock","docs":"https://appdoc.app/artifact/org.spockframework/spock-spring/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}