EasyMockRunner
Date: 2015-09-17

org.easymock

## Class EasyMockRunner

- java.lang.Object
- - org.junit.runner.Runner
  - - org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
    - - org.junit.runners.BlockJUnit4ClassRunner
      - - org.easymock.EasyMockRunner

- All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

      public class EasyMockRunner
      extends org.junit.runners.BlockJUnit4ClassRunner

  JUnit runner used to process `Mock` and `TestSubject` annotations. Note that this runner only works with JUnit 4.5 or higher
  Since:
    3.2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EasyMockRunner(java.lang.Class<?> klass)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.junit.runners.model.Statement` | `withBefores(org.junit.runners.model.FrameworkMethod method, java.lang.Object target, org.junit.runners.model.Statement statement)` We are required to override a deprecated method because it's the only way the perform the mock injection before the `@Before` of our class being called.

    - ### Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner

      `collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, getTestRules, methodBlock, methodInvoker, possiblyExpectingExceptions, rules, runChild, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withPotentialTimeout`

    - ### Methods inherited from class org.junit.runners.ParentRunner

      `childrenInvoker, classBlock, classRules, filter, getDescription, getName, getRunnerAnnotations, getTestClass, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses`

    - ### Methods inherited from class org.junit.runner.Runner

      `testCount`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EasyMockRunner

          public EasyMockRunner(java.lang.Class<?> klass)
                         throws org.junit.runners.model.InitializationError

      Throws:
        `org.junit.runners.model.InitializationError`

  - ### Method Detail

    - #### withBefores

          protected org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod method,
                                                      java.lang.Object target,
                                                      org.junit.runners.model.Statement statement)

      We are required to override a deprecated method because it's the only way the perform the mock injection before the `@Before` of our class being called. Using a statement wouldn't work.
      Overrides:
        `withBefores` in class `org.junit.runners.BlockJUnit4ClassRunner`
      Parameters:
        `method` - test method class
        `target` - test class instance
        `statement` - current statement
      Returns:
        a statement to return to the caller