diff --git a/build.gradle b/build.gradle index ad400436e2..3e5b94b718 100755 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ ext { jetbrainsAnnotations: "org.jetbrains:annotations:13.0", ant: "org.apache.ant:ant:1.9.7", asm: "org.ow2.asm:asm:5.2", - bytebuddy: "net.bytebuddy:byte-buddy:1.7.0", + bytebuddy: "net.bytebuddy:byte-buddy:1.7.6", cglib: "cglib:cglib-nodep:3.2.5", groovy: "org.codehaus.groovy:groovy-all:$groovyVersion", h2database: "com.h2database:h2:1.3.176", diff --git a/spock-core/src/main/java/org/spockframework/mock/runtime/ProxyBasedMockFactory.java b/spock-core/src/main/java/org/spockframework/mock/runtime/ProxyBasedMockFactory.java index 84936e9609..0f10d9c92e 100644 --- a/spock-core/src/main/java/org/spockframework/mock/runtime/ProxyBasedMockFactory.java +++ b/spock-core/src/main/java/org/spockframework/mock/runtime/ProxyBasedMockFactory.java @@ -26,6 +26,7 @@ import net.bytebuddy.*; import net.bytebuddy.description.modifier.*; import net.bytebuddy.dynamic.Transformer; +import net.bytebuddy.dynamic.scaffold.TypeValidation; import net.bytebuddy.implementation.*; import net.bytebuddy.implementation.bind.annotation.Morph; import net.sf.cglib.proxy.*; @@ -103,6 +104,7 @@ static Object createMock(final Class type, public Class call() throws Exception { return new ByteBuddy() .with(new NamingStrategy.SuffixingRandom("SpockMock")) + .with(TypeValidation.DISABLED) // https://github.com/spockframework/spock/issues/776 .ignore(none()) .subclass(type) .implement(additionalInterfaces)