spock

    3热度

    1回答

    我试图实现类似的功能在以下TestNG的代码: @Test public void method1() {} @Test(dependsOnMethods = { "method1" }) public void method2() {} 我无法找到类似的概念斯波克。那可能吗?

    0热度

    2回答

    我使用内置spock的Grails 3.1.7。它看起来像是在单元测试执行过程中遇到由控制器呈现的服务返回值的问题。 Service方法返回null,然后控制器抛出一个GroovyRuntimeException,由于返回“null”,抱怨“无法解析调用哪个方法”。 控制器的动作码的样品:测试套件代码的 JSON composeJsonResponse(instance, String succe

    0热度

    1回答

    我正在尝试将Grails应用程序从2.4.5升级到2.5.5。当我运行test-app,我得到以下内容: Error running unit tests: null java.lang.AbstractMethodError at org.spockframework.runtime.GlobalExtensionRegistry.startGlobalExtensions(Glo

    0热度

    1回答

    我与Grails的2.4.5工作,努力让Grails的划定不同的异常类型。 假设我想嘲笑下面: class FooController { def barService ... def fooAction() { try { barService.someMethod(params) } catch(e) { if (e instanceof FooException) { ...

    5热度

    1回答

    他,大家好!我的测试由jenkins从一般软件包运行。我可以在spock中设置测试包,它将首先运行,如果在此包中不会通过任何测试,则应该跳过其他测试。我见过这样的例子: import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({Te

    0热度

    2回答

    我有一个自定义的验证使用Spring bean的约束的命令对象: class UserPasswordCommand { String currentPassword //other fields.... static constraints = { currentPassword validator: { currPass, upc ->

    0热度

    1回答

    给定一个域类,如: class Person { String name static mapping = { name column: 'TheName' } } 为Person的name属性实际上映射到SQL表的TheName列。 那么,我该如何测试,使用Spock来确保映射存在于域类中?如何获得访问映射,当我创建一个新的Person对象为这样

    0热度

    1回答

    我想消费一个web服务并添加断言到其响应。我得到以下异常: groovyx.net.http.ResponseParseException: at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:495) ...... at Subscription.Order Products(Subsc

    0热度

    1回答

    在我的项目中,我们使用spock进行单元测试。我想用三叶草配置spock测试用例,以便它可以生成覆盖率报告。我已经按照步骤在maven中配置它。但是,我无法正确配置它。 任何人都可以指导我配置spock的三叶草? 我的groovy测试用例在src/test/groovy包中。 感谢, 周杰伦帕特尔

    0热度

    1回答

    我在gock单元测试中嘲笑grails 3.1.7中的InputStream有问题。 我在link之前问过类似的问题。 问题已解决,但当我添加@CompileStatic注释时,它返回。我的代码: @CompileStatic class MongoImage implements Image { GridFSFile gridFSFile ... byte[] g