org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: interface com.microsoft.windowsazure.services.servicebus.ServiceBusContract Mockito can only mock visible & non-final classes. If you're not sure why you're getting this error, please report to the mailing list.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via github.com by Unknown author, 1 year ago
Mockito cannot mock this class: interface com.microsoft.windowsazure.services.servicebus.ServiceBusContract Mockito can only mock visible & non-final classes. If you're not sure why you're getting this error, please report to the mailing list.
via GitHub by Stephan202
, 2 years ago
Mockito cannot mock this class: interface com.microsoft.windowsazure.services.servicebus.ServiceBusContract Mockito can only mock visible & non-final classes. If you're not sure why you're getting this error, please report to the mailing list.
org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: interface com.microsoft.windowsazure.services.servicebus.ServiceBusContract Mockito can only mock visible & non-final classes. If you're not sure why you're getting this error, please report to the mailing list.
at java.lang.ClassLoader.checkCerts(ClassLoader.java:895)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:665)
at java.lang.ClassLoader.defineClass(ClassLoader.java:758)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection$ClassLoadingAction.run(ClassInjector.java:336)
at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.inject(ClassInjector.java:122)
at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$5.load(ClassLoadingStrategy.java:144)
at org.mockito.internal.creation.bytebuddy.MockBytecodeGenerator.generateMockClass(MockBytecodeGenerator.java:55)
at org.mockito.internal.creation.bytebuddy.CachingMockBytecodeGenerator$CachedBytecodeGenerator.generate(CachingMockBytecodeGenerator.java:72)
at org.mockito.internal.creation.bytebuddy.CachingMockBytecodeGenerator$CachedBytecodeGenerator.getOrGenerateMockClass(CachingMockBytecodeGenerator.java:64)
at org.mockito.internal.creation.bytebuddy.CachingMockBytecodeGenerator.get(CachingMockBytecodeGenerator.java:27)
at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createProxyClass(ByteBuddyMockMaker.java:49)
at org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:22)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:33)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:59)
at org.mockito.Mockito.mock(Mockito.java:1378)
at org.mockito.Mockito.mock(Mockito.java:1256)

Users with the same issue

You are the first who have seen this exception.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.