BAEL-2947 - Guide to Junit 4 Rules

This commit is contained in:
Jon Cook
2019-08-12 13:37:48 +02:00
parent f918e37fa6
commit 7d1499f5c3
8 changed files with 237 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package com.baeldung.rules;
import static org.junit.Assert.assertTrue;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.RuleChain;
public class RuleChainUnitTest {
@Rule
public RuleChain chain = RuleChain.outerRule(new MessageLogger("First rule"))
.around(new MessageLogger("Second rule"))
.around(new MessageLogger("Third rule"));
@Test
public void givenRuleChain_whenTestRuns_thenChainOrderApplied() {
assertTrue(true);
}
}