snowe
02/14/2019, 10:16 PMMockito cannot mock this class: class org.springframework.amqp.rabbit.core.RabbitTemplate.
If you're not sure why you're getting this error, please report to the mailing list.
Java : 1.8
JVM vendor name : Oracle Corporation
JVM vendor version : 25.192-b12
JVM name : Java HotSpot(TM) 64-Bit Server VM
JVM version : 1.8.0_192-b12
JVM info : mixed mode
OS name : Mac OS X
OS version : 10.14.3
You are seeing this disclaimer because Mockito is configured to create inlined mocks.
You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.
Underlying exception : org.mockito.exceptions.base.MockitoException: Could not modify all classes [class java.lang.Object, interface org.springframework.amqp.rabbit.core.RabbitOperations, interface org.springframework.beans.factory.BeanFactoryAware, class org.springframework.amqp.rabbit.connection.RabbitAccessor, interface org.springframework.amqp.core.MessageListener, interface org.springframework.beans.factory.Aware, class org.springframework.amqp.rabbit.core.RabbitTemplate, interface org.springframework.amqp.core.AmqpTemplate, interface org.springframework.amqp.rabbit.connection.PublisherCallbackChannel$Listener, interface org.springframework.beans.factory.BeanNameAware, interface org.springframework.context.Lifecycle, interface org.springframework.amqp.rabbit.support.ListenerContainerAware, interface org.springframework.beans.factory.InitializingBean]
Obviously it makes sense, but the underlying problem is that this code works perfectly fine on Spring Boot 1.5.6, but as soon as I upgraded to 2.1.2.RELEASE I receive this error.