You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Security annotations on interfaces are in most cases not inherited by interface implementors. This build item allows to register interfaces whose implementors will inherit security annotations. If this build item is used extensively, it can get very complex, and we would create situations, where users can hardly tell precedence, like what will happen if different repeatable annotation instance (like the `PermissionsAllowed` annotation) is placed on both implemented and interface method. Or does method-level interface annotation take precedence over implementors class-level annotation. Examples could continue, for which reason we aim to support simple cases for now.
8962
+
The all the implementors of interfaces matched by this build item annotation will inherit security annotations from interface methods and the interface class-level security annotations only apply directly on the methods declared on the interface. All scenarios that are supposed to work are tested. Any scenario that is not working is not yet supported.
@@ -666,7 +666,7 @@ Now, Quarkus will process this new task which will result in the bytecode genera
666
666
When developing a Quarkus extension, you mainly want to test your feature is properly deployed in an application and works as expected.
667
667
That's why the tests will be hosted in the `deployment` module.
668
668
669
-
Quarkus proposes facilities to test extensions via the `quarkus-junit5-internal` artifact (which should already be in the deployment pom.xml), in particular the `io.quarkus.test.QuarkusUnitTest` runner which starts an application with your extension.
669
+
Quarkus proposes facilities to test extensions via the `quarkus-junit-internal` artifact (which should already be in the deployment pom.xml), in particular the `io.quarkus.test.QuarkusUnitTest` runner which starts an application with your extension.
670
670
671
671
We will use https://rest-assured.io[RestAssured] (massively used in Quarkus) to test our HTTP endpoint.
672
672
Let's add the `rest-assured` dependency into the `./greeting-extension/deployment/pom.xml`.
`quarkus-junit5` is required for testing, as it provides the `@QuarkusTest` annotation that controls the testing framework.
82
+
`quarkus-junit` is required for testing, as it provides the `@QuarkusTest` annotation that controls the testing framework.
83
83
`rest-assured` is not required but is a convenient way to test HTTP endpoints, we also provide integration that automatically
84
84
sets the correct URL so no configuration is required.
85
85
86
-
Because we are using JUnit 5, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin]
87
-
must be set, as the default version does not support Junit 5:
86
+
Because we are using JUnit, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin]
87
+
must be set, as the default version does not support JUnit:
88
88
89
89
[source,xml,subs=attributes+]
90
90
----
@@ -470,11 +470,11 @@ a bit slower, as it adds a shutdown/startup cycle to the test time, but gives a
470
470
471
471
To reduce the amount of times Quarkus needs to restart, `io.quarkus.test.junit.util.QuarkusTestProfileAwareClassOrderer`
472
472
is registered as a global `ClassOrderer` as described in the
473
-
link:https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-execution-order-classes[JUnit 5 User Guide].
473
+
link:https://docs.junit.org/current/user-guide/#writing-tests-test-execution-order-classes[JUnit User Guide].
474
474
The behavior of this `ClassOrderer` is configurable via `application.properties` using the property
475
475
`quarkus.test.class-orderer`. The property accepts the FQCN of the `ClassOrderer` to use. If the class cannot be found,
476
476
it fallbacks to JUnit default behaviour which does not set a `ClassOrderer` at all. It can also be disabled entirely by
477
-
setting another `ClassOrderer` that is provided by JUnit 5 or even your own custom one.
477
+
setting another `ClassOrderer` that is provided by JUnit or even your own custom one.
478
478
479
479
=== Writing a Profile
480
480
@@ -704,7 +704,7 @@ matches the value of `quarkus.test.profile.tags`.
704
704
705
705
== Nested Tests
706
706
707
-
JUnit 5 https://junit.org/junit5/docs/current/user-guide/#writing-tests-nested[@Nested tests] are useful for structuring more complex test scenarios.
707
+
JUnit https://docs.junit.org/current/user-guide/#writing-tests-nested[@Nested tests] are useful for structuring more complex test scenarios.
708
708
However, note that it is not possible to assign different test profiles or resources to nested tests within the same parent class.
709
709
710
710
== Mock Support
@@ -836,12 +836,12 @@ Building on the features provided by `QuarkusMock`, Quarkus also allows users to
836
836
837
837
[IMPORTANT]
838
838
====
839
-
This functionality is available with the `@io.quarkus.test.InjectMock` annotation **only if** the `quarkus-junit5-mockito` dependency is present:
839
+
This functionality is available with the `@io.quarkus.test.InjectMock` annotation **only if** the `quarkus-junit-mockito` dependency is present:
840
840
[source,xml]
841
841
----
842
842
<dependency>
843
843
<groupId>io.quarkus</groupId>
844
-
<artifactId>quarkus-junit5-mockito</artifactId>
844
+
<artifactId>quarkus-junit-mockito</artifactId>
845
845
<scope>test</scope>
846
846
</dependency>
847
847
----
@@ -958,7 +958,7 @@ This is considered an advanced option and should only be performed if you fully
958
958
==== Using Spies instead of Mocks with `@InjectSpy`
959
959
960
960
Building on the features provided by `InjectMock`, Quarkus also allows users to effortlessly take advantage of link:https://site.mockito.org/[Mockito] for spying on the beans supported by `QuarkusMock`.
961
-
This functionality is available via the `@io.quarkus.test.junit.mockito.InjectSpy` annotation which is available in the `quarkus-junit5-mockito` dependency.
961
+
This functionality is available via the `@io.quarkus.test.junit.mockito.InjectSpy` annotation which is available in the `quarkus-junit-mockito` dependency.
962
962
963
963
Sometimes when testing you only need to verify that a certain logical path was taken, or you only need to stub out a single method's response while still executing the rest of the methods on the Spied clone. Please see link:https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#13[Mockito documentation - Spying on real objects] for more details on Spy partial mocks.
964
964
In either of those situations a Spy of the object is preferable.
@@ -1484,7 +1484,7 @@ while the latter three can coexist.
1484
1484
The reason of this restriction is that `@QuarkusTest` starts a Quarkus server for the whole lifetime of the tests execution run,
1485
1485
thus preventing the other tests to start their own Quarkus server.
1486
1486
1487
-
To alleviate this restriction, the `@QuarkusTest` annotation defines a JUnit 5 `@Tag`: `io.quarkus.test.junit.QuarkusTest`.
1487
+
To alleviate this restriction, the `@QuarkusTest` annotation defines a JUnit `@Tag`: `io.quarkus.test.junit.QuarkusTest`.
1488
1488
You can use this tag to isolate the `@QuarkusTest` test in a specific execution run, for example with the Maven Surefire Plugin:
1489
1489
1490
1490
[source,xml]
@@ -1699,7 +1699,7 @@ public @interface QuarkusSecurityTest { <1>
1699
1699
== Testing Components
1700
1700
1701
1701
Quarkus provides the `QuarkusComponentTestExtension`, a JUnit extension to ease the testing of components and mocking of their dependencies.
1702
-
This JUnit extension is available in the `quarkus-junit5-component` dependency.
1702
+
This JUnit extension is available in the `quarkus-junit-component` dependency.
1703
1703
1704
1704
Let's have a component `Foo` - a CDI bean with two injection points.
Because of this, in the case of Maven, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin] must be set, as the default version does not support JUnit 5:
335
+
Because of this, in the case of Maven, the version of the https://maven.apache.org/surefire/maven-surefire-plugin/[Surefire Maven Plugin] must be set, as the default version does not support JUnit:
0 commit comments