Export to GitHub

spock - issue #388

Test class initialization error with private static method.


Posted on Feb 16, 2015 by Happy Giraffe

What steps will reproduce the problem? If possible, provide source code and stack trace. 1. Compile the attached code on CI (company package names are omitted). 2. An initialization error appears (see attached stack trace).

What version of Spock and Groovy are you using?

I use groovy version 2.4.0 with spock-core and spock-spring version 0.7

Please provide any additional information below. You can also assign labels.

The compilation error went away after I moved the content of the private static method into the setup() method, declared a corresponding class variable to hold the outcome and deleted the private static method. Another noteable thing was that I got the error only when compiling code on CI, not locally, and I don't know how the CI was configured. Classes that are being mocked/autowired in the given code were written in Java 7, JDK 1.7.0_72.

Attachments

Status: New

Labels:
Type-Defect Module-Core