Skip to content

Instantly share code, notes, and snippets.

@Romeh
Last active December 3, 2017 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Romeh/c20e0011efeb8a60c880a9967b81b545 to your computer and use it in GitHub Desktop.
Save Romeh/c20e0011efeb8a60c880a9967b81b545 to your computer and use it in GitHub Desktop.
package com.test.SpringBootSample.retry;
/**
* Created by id961900 on 05/09/2017.
*/
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Retries a unit-test according to the attributes set here
* <p>
* The class containing the test(s) decorated with this annotation must have a public field of type {@link RetryRule}
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface Retry {
/**
* @return the number of times to try this method before the failure is propagated through
*/
int times() default 3;
/**
* @return how long to sleep between invocations of the unit tests, in milliseconds
*/
long timeout() default 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment