@ SuppressWarnings ( "unchecked" ) private static List < TestRule > getRuleList ( RuleChain ruleChain ) { Field ruleChainList ; try { String fieldName = JUnitConfig . getConfig ( ) . getString ( JUnitSettings . RULE_CHAIN_LIST . key ( ) ) ; ruleChainList = RuleChain . class . getDeclaredField ( fieldName ) ; ruleChainList . setAccessible ( true ) ; return ( List < TestRule > ) ruleChainList . get ( ruleChain ) ; } catch ( NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e ) { throw UncheckedThrow . throwUnchecked ( e ) ; } }
Get the list of test rules from the specified rule chain .