Class RunnerFactory


  • public class RunnerFactory
    extends java.lang.Object
    Creates instances of Mockito JUnit Runner in a safe way, e.g. detecting inadequate version of JUnit, etc.
    • Constructor Detail

      • RunnerFactory

        public RunnerFactory()
    • Method Detail

      • create

        public InternalRunner create​(java.lang.Class<?> klass)
                              throws java.lang.reflect.InvocationTargetException
        Creates silent runner implementation
        Throws:
        java.lang.reflect.InvocationTargetException
      • createStrict

        public InternalRunner createStrict​(java.lang.Class<?> klass)
                                    throws java.lang.reflect.InvocationTargetException
        Creates strict runner implementation
        Throws:
        java.lang.reflect.InvocationTargetException
      • createStrictStubs

        public InternalRunner createStrictStubs​(java.lang.Class<?> klass)
                                         throws java.lang.reflect.InvocationTargetException
        Creates strict stubs runner implementation TODO, let's try to apply Brice suggestion and use switch + Strictness
        Throws:
        java.lang.reflect.InvocationTargetException
      • create

        public InternalRunner create​(java.lang.Class<?> klass,
                                     Supplier<MockitoTestListener> listenerSupplier)
                              throws java.lang.reflect.InvocationTargetException
        Creates runner implementation with provided listener supplier
        Throws:
        java.lang.reflect.InvocationTargetException