Class DefaultMockitoConfiguration

  • All Implemented Interfaces:
    IMockitoConfiguration

    public class DefaultMockitoConfiguration
    extends java.lang.Object
    implements IMockitoConfiguration
    DefaultConfiguration of Mockito framework

    Currently it doesn't have many configuration options but it will probably change if future.

    See javadocs for IMockitoConfiguration on info how to configure Mockito

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cleansStackTrace()
      This should be turned on unless you're a Mockito developer and you wish to have verbose (read: messy) stack traces that only few understand (eg: Mockito developers)
      boolean enableClassCache()
      Allow objenesis to cache classes.
      AnnotationEngine getAnnotationEngine()
      Configures annotations for mocks.
      Answer<java.lang.Object> getDefaultAnswer()
      Allows configuring the default answers of unstubbed invocations
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultMockitoConfiguration

        public DefaultMockitoConfiguration()
    • Method Detail

      • getAnnotationEngine

        public AnnotationEngine getAnnotationEngine()
        Description copied from interface: IMockitoConfiguration
        Configures annotations for mocks.

        This method will have lower priority that the new extension mechanism. That is if it exists on the classpath both a class org.mockito.configuration.MockitoConfiguration and a file mockito-extensions/org.mockito.plugins.AnnotationEngine then the implementation of org.mockito.configuration.MockitoConfiguration will be chosen instead of the one in the file.

        See javadoc for IMockitoConfiguration

        Specified by:
        getAnnotationEngine in interface IMockitoConfiguration
      • cleansStackTrace

        public boolean cleansStackTrace()
        Description copied from interface: IMockitoConfiguration
        This should be turned on unless you're a Mockito developer and you wish to have verbose (read: messy) stack traces that only few understand (eg: Mockito developers)

        See javadoc for IMockitoConfiguration

        Specified by:
        cleansStackTrace in interface IMockitoConfiguration
        Returns:
        if Mockito should clean stack traces
      • enableClassCache

        public boolean enableClassCache()
        Description copied from interface: IMockitoConfiguration
        Allow objenesis to cache classes. If you're in an environment where classes are dynamically reloaded, you can disable this to avoid classcast exceptions.
        Specified by:
        enableClassCache in interface IMockitoConfiguration