Спок неопознанная метка блока: дано - PullRequest
0 голосов
/ 09 марта 2019

У меня есть следующий тест спока.

package com.arch.unit.category
import com.arch.domain.category.Category
import com.arch.domain.category.CategoryRepository
import com.arch.handler.category.CategoryCreateHandler
import com.arch.message.command.category.CategoryCreateCommand
import spock.lang.Specification
def "create category expected succeed"() {
    given:
    def command = new CategoryCreateCommand("Php")
    and:
    categoryRepository.save(_ as Category) >> new Category("Php")
    when:
    def response = handler.execute(command)
    then:
    response.code == 100
}

Не работает.Я получаю сообщение об ошибке "Ошибка: (20, 16) Groovyc: нераспознанная метка блока: задано"

Мои зависимости

    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('org.codehaus.groovy:groovy-all')
    testCompile('org.spockframework:spock-core:1.1-groovy-2.4-rc-4')
    testCompile('org.spockframework:spock-spring:1.1-groovy-2.4-rc-4')

Среда: Windows, Java8, Intellij Community Edition

Это работало на моем Mac раньше.Но сейчас не работает.

...