春のコンテキストで構成されたルールをスポック仕様に挿入しようとしています。
@ContextConfiguration(locations=["spring.xml"])
class TestSpec extends Specification {
@Rule @Inject //@Autowired
public ActivitiRule activitiRule;
@Deployment
def "Process test"() {
when:
//...
then:
//...
}
}
問題は、 spock が@Inject
or@Autowired
アノテーションを尊重せずにルールをインスタンス化することです。JUnit では、これは期待どおりに機能します。スポックにルールを注入することは可能ですか?