When registered via a bean definition the mock is subject to post-processing. This includes creation of proxies for caching and async processing. It also means that the container attempts to autowire the mock's fields (if it was created from a class rather than an interface). We could avoid this by adding the bean to the bean factory as a singleton.