Skip to content

Instantly share code, notes, and snippets.

@abyx
abyx / RetrierTest.java
Created March 31, 2011 20:51
Simple JUnit rule to make tests retry
public class RetrierTest {
private static int count = 0;
@Rule public RetryRule rule = new RetryRule();
@Test
@Retry
public void failsFirst() throws Exception {
count++;
assertEquals(2, count);