- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, org.springframework.core.Ordered
public class NoOpMockitoPostProcessor
extends org.springframework.boot.test.mock.mockito.MockitoPostProcessor
So, this is a long story and exists as a workaround for a known Broadleaf problem with
LTW. This BeanFactoryPostProcessor actually scans every bean definition early to look for
appropriate configuration classes for mocks. It is automatically registered as part of "spring-boot-starter-test"
artifact inclusion. This ends up loading (but not initializing) any entity class along the way
(e.g. a entity class may be mentioned in a @Service class's import block). As a result,
our LTW process complains about un-transformed entities.
This hack is to disable this post processor, since we don't need @Mock support for this MVC integration test.
A longer term fix is to find a earlier integration point for registering class transformers with the
ClassLoader during the Spring startup lifecycle.
- Author:
- Jeff Fischer