use of org.junit.rules.RunRules in project pact-jvm by DiUS.
the class InteractionRunner method withRules.
protected Statement withRules(final Interaction interaction, final Object target, final Statement statement) {
final List<TestRule> testRules = testClass.getAnnotatedMethodValues(target, Rule.class, TestRule.class);
testRules.addAll(testClass.getAnnotatedFieldValues(target, Rule.class, TestRule.class));
return testRules.isEmpty() ? statement : new RunRules(statement, testRules, describeChild(interaction));
}