Files
hibernate-demo/n-plus-one-guard/src/main/java/com/ankurm/nplusone/MaxSelects.java
T

20 lines
612 B
Java

package com.ankurm.nplusone;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.extension.ExtendWith;
/**
* Query budget for one test: the test fails if it sends more than {@link #value()} SELECT statements.
* Put it on a method, or on the class to apply the same budget to every test in it.
*/
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@ExtendWith(QueryGuardExtension.class)
public @interface MaxSelects {
int value();
}