以下测试失败,并且我可以在日志中看到根本没有构建任何应用程序上下文。但是我在这里想念什么?
package my.dwh.etl
import my.dwh.DwhApplication
import groovy.util.logging.Log
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.context.ApplicationContext
import spock.lang.Specification
@Log
@SpringBootTest(classes = DwhApplication.class)
class ETL_IT extends Specification {
@Autowired
ApplicationContext context
def "test integration of loading StackedWithHeaderAndAllTypesSource and storing into h2"() {
given:
def a
when:
a = 1
then:
context != null
}
}
答案 0 :(得分:0)
Spock测试会找到名称后缀为Spec
的类。您必须遵循以下规则来创建我们的Spock规范类的名称:[The name of the tested/specified unit]Spec