Skip to content

Commit

Permalink
Add note about the use of @Launch with @beforeeach
Browse files Browse the repository at this point in the history
Relates: #26711
  • Loading branch information
geoand committed Jul 14, 2022
1 parent aa70206 commit d867ebf
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.BeforeEach;

/**
* Annotation for {@link QuarkusMainTest} and {@link QuarkusMainIntegrationTest} that is used to launch command line
* applications.
* The annotation is meant to be used on test methods only.
*
* See also {@link LaunchResult} and {@link QuarkusMainLauncher}
*
* IMPORTANT: This annotation should not be used together test setup methods annotated with {@link BeforeEach}
* as the latter will be executed after the application is launched (which is almost certainly not the desired behavior).
* If such methods are needed for tests, users are encouraged to use {@link QuarkusMainLauncher} and launch the application
* in the test method.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
Expand Down

0 comments on commit d867ebf

Please sign in to comment.