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.

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Stack trace

  • 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$ClassLoadingAction.run(ClassInjector.java:306) at java.security.AccessController.doPrivileged(Native Method) at net.bytebuddy.dynamic.loading.ClassInjector$UsingReflection.inject(ClassInjector.java:122) at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$Default$5.load(ClassLoadingStrategy.java:144) at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:3380) 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)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

We couldn't find other users who have seen this exception.