We have a ServletFilter we want to unit tests with Spock and check calls to HttpServletRequest. The following code throws java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/http/Cookie def "some meaningless test"(){ given: HttpServletRequest servletRequest = Mock(HttpServletRequest) when: 1+1 then: true } The JavaEE 5 API (and thu