Class RetryRule

java.lang.Object
org.elasticsearch.test.RetryRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class RetryRule extends Object implements org.junit.rules.TestRule
Provides a way to retry a failed test. To use this functionality add something like the following to your test class:
@Rule
public RetryRule retry = new RetryRule(3, TimeValue.timeValueSeconds(1));
  • Constructor Details

    • RetryRule

      public RetryRule(int maxAttempts, TimeValue retryDelay)
  • Method Details

    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement statement, org.junit.runner.Description description)
      Specified by:
      apply in interface org.junit.rules.TestRule