Skip to content

Updating mockk from 1.13.3 to 1.13.4 causes test failures #12695

@sjohnr

Description

@sjohnr

Some example failures include:

java.lang.ClassCastException: class org.slf4j.helpers.NOPLogger cannot be cast to class ch.qos.logback.classic.Logger (org.slf4j.helpers.NOPLogger and ch.qos.logback.classic.Logger are in unnamed module of loader 'app')
	at org.springframework.security.config.annotation.web.configurers.NamespaceDebugTests.mockAppenderFor(NamespaceDebugTests.java:77)
	at org.springframework.security.config.annotation.web.configurers.NamespaceDebugTests.requestWhenDebugSetToFalseThenDoesNotLogDebugInformation(NamespaceDebugTests.java:68)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
...
java.lang.UnsupportedOperationException: This class is an internal synthetic class generated by the Kotlin compiler, such as an anonymous class for a lambda, a SAM wrapper, a callable reference, etc. It's not a Kotlin class or interface, so the reflection library has no idea what declarations it has. Please use Java reflection to inspect this class: class org.springframework.security.config.web.server.ServerCsrfDslTests$CustomAccessDeniedHandlerConfig$Companion$ACCESS_DENIED_HANDLER$1
	at kotlin.reflect.jvm.internal.KClassImpl.reportUnresolvedClass(KClassImpl.kt:316)
	at kotlin.reflect.jvm.internal.KClassImpl.access$reportUnresolvedClass(KClassImpl.kt:44)
	at kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:56)
	at kotlin.reflect.jvm.internal.KClassImpl$Data$descriptor$2.invoke(KClassImpl.kt:48)
	at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:93)
	at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:32)
	at kotlin.reflect.jvm.internal.KClassImpl$Data.getDescriptor(KClassImpl.kt:48)
	at kotlin.reflect.jvm.internal.KClassImpl.getDescriptor(KClassImpl.kt:182)
	at kotlin.reflect.jvm.internal.KClassImpl.isSealed(KClassImpl.kt:274)
	at io.mockk.proxy.common.ProxyMaker.findActualClassToBeProxied(ProxyMaker.kt:122)
	at io.mockk.proxy.common.ProxyMaker.proxy(ProxyMaker.kt:47)
	at io.mockk.impl.instantiation.JvmObjectMockFactory.objectMockk(JvmObjectMockFactory.kt:43)
	at org.springframework.security.config.web.server.ServerCsrfDslTests.csrf when custom access denied handler then handler used(ServerCsrfDslTests.kt:366)
...

Metadata

Metadata

Assignees

Labels

in: configAn issue in spring-security-configstatus: duplicateA duplicate of another issuetype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions