com.github.bedrin.jdbc.sniffer.Expectation Maven / Gradle / Ivy
package com.github.bedrin.jdbc.sniffer;
import com.github.bedrin.jdbc.sniffer.Query;
import com.github.bedrin.jdbc.sniffer.Threads;
import com.github.bedrin.jdbc.sniffer.junit.QueryCounter;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Adds an expectation about the number of queries generated by given test method
* @see QueryCounter
* @since 2.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE, ElementType.ANNOTATION_TYPE})
public @interface Expectation {
/**
* @since 2.0
*/
int value() default -1;
/**
* @since 2.0
*/
int atMost() default -1;
/**
* @since 2.0
*/
int atLeast() default -1;
/**
* @since 2.0
*/
Threads threads() default Threads.CURRENT;
/**
* @since 2.2
*/
Query query() default Query.ANY;
}