src/main/java/com/greghaskins/spectrum/internal/junit/Rules.java
/**
   * Add a test object junit.rule set.
   * @param object the JUnit test object - this will never be recreated
   * @param target the insertion point to add JUnit rules as hooks
   * @param <T> type of the test object
   */
Add a test object junit.rule set.
@param object the JUnit test object - this will never be recreated
@param target the insertion point to add JUnit rules as hooks
@param  type of the test object
Add a test object junit . rule set . @param object the JUnit test object - this will never be recreated @param target the insertion point to add JUnit rules as hooks @param type of the test object
static <T> void applyRules(T object, Target target) {
    RuleContext<T> context = new RuleContext<>(object);
    if (context.hasAnyJUnitAnnotations()) {
      target.addHook(context.classHook(), HookContext.AppliesTo.ONCE,
          HookContext.Precedence.LOCAL);
      target.addHook(context.methodHook(), HookContext.AppliesTo.ATOMIC_ONLY,
          HookContext.Precedence.LOCAL);
    }
  }
static < T > void applyRules ( T object , Target target ) { RuleContext < T > context = new RuleContext < > ( object ) ; if ( context . hasAnyJUnitAnnotations ( ) ) { target . addHook ( context . classHook ( ) , HookContext . AppliesTo . ONCE , HookContext . Precedence . LOCAL ) ; target . addHook ( context . methodHook ( ) , HookContext . AppliesTo . ATOMIC_ONLY , HookContext . Precedence . LOCAL ) ; } }
Add a test object junit.rule set.
Add a test object junit . rule set .