File tree 7 files changed +43
-4
lines changed
src/main/java/org/mockito/configuration
7 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 2576
2576
<artifactId >quarkus-junit5-mockito</artifactId >
2577
2577
<version >${project.version} </version >
2578
2578
</dependency >
2579
+ <dependency >
2580
+ <groupId >io.quarkus</groupId >
2581
+ <artifactId >quarkus-junit5-mockito-config</artifactId >
2582
+ <version >${project.version} </version >
2583
+ </dependency >
2579
2584
<dependency >
2580
2585
<groupId >io.quarkus</groupId >
2581
2586
<artifactId >quarkus-junit5-vertx</artifactId >
Original file line number Diff line number Diff line change 170
170
<parentFirstArtifact >io.quarkus:quarkus-class-change-agent</parentFirstArtifact >
171
171
<parentFirstArtifact >org.jacoco:org.jacoco.agent:runtime</parentFirstArtifact >
172
172
<parentFirstArtifact >io.quarkus:quarkus-bootstrap-gradle-resolver</parentFirstArtifact >
173
+ <parentFirstArtifact >io.quarkus:quarkus-junit5-mockito-config</parentFirstArtifact >
173
174
174
175
<!-- RestAssured uses groovy, which seems to do some things with soft references that
175
176
prevent the ClassLoader from being GC'ed, see https://github.com/quarkusio/quarkus/issues/12498 -->
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <modelVersion >4.0.0</modelVersion >
6
+
7
+ <parent >
8
+ <groupId >io.quarkus</groupId >
9
+ <artifactId >quarkus-test-framework</artifactId >
10
+ <version >999-SNAPSHOT</version >
11
+ </parent >
12
+
13
+ <artifactId >quarkus-junit5-mockito-config</artifactId >
14
+ <name >Quarkus - Test framework - JUnit 5 - Mockito Config</name >
15
+ <description >
16
+ Contains a MockitoConfiguration that has to be loaded parent-first to work in continuous testing.
17
+ It is separated from junit5-mockito to minimize the blast radius.
18
+ </description >
19
+
20
+ <dependencies >
21
+ <dependency >
22
+ <groupId >org.mockito</groupId >
23
+ <artifactId >mockito-core</artifactId >
24
+ </dependency >
25
+ </dependencies >
26
+
27
+ </project >
Original file line number Diff line number Diff line change 4
4
5
5
import org .mockito .stubbing .Answer ;
6
6
7
- import io .quarkus .test .junit .mockito .internal .MutinyAnswer ;
8
-
9
7
public class MockitoConfiguration extends DefaultMockitoConfiguration {
10
8
11
9
@ SuppressWarnings ("unchecked" )
@@ -14,7 +12,7 @@ public Answer<Object> getDefaultAnswer() {
14
12
ClassLoader cl = Thread .currentThread ().getContextClassLoader ();
15
13
try {
16
14
// we need to load it from the TCCL (QuarkusClassLoader) instead of our class loader (JUnit CL)
17
- Class <?> mutinyAnswer = cl .loadClass (MutinyAnswer . class . getName () );
15
+ Class <?> mutinyAnswer = cl .loadClass ("io.quarkus.test.junit.mockito.internal.MutinyAnswer" );
18
16
return (Answer <Object >) mutinyAnswer .getDeclaredConstructor ().newInstance ();
19
17
} catch (ClassNotFoundException | SecurityException | IllegalArgumentException | IllegalAccessException
20
18
| InstantiationException | NoSuchMethodException | InvocationTargetException e ) {
Original file line number Diff line number Diff line change 18
18
<groupId >io.quarkus</groupId >
19
19
<artifactId >quarkus-junit5</artifactId >
20
20
</dependency >
21
+ <!-- Contains the MockitoConfiguration that adds MutinyAnswer as a default answer.
22
+ The dependency is in this direction so that users don't need to worry about it
23
+ and only have to add this dependency (quarkus-junit5-mockito), but not ...-config. -->
24
+ <dependency >
25
+ <groupId >io.quarkus</groupId >
26
+ <artifactId >quarkus-junit5-mockito-config</artifactId >
27
+ </dependency >
21
28
<dependency >
22
29
<groupId >io.quarkus</groupId >
23
30
<artifactId >quarkus-arc-deployment</artifactId >
Original file line number Diff line number Diff line change 13
13
<artifactId >quarkus-junit5-properties</artifactId >
14
14
<name >Quarkus - Test Framework - JUnit 5 - Properties</name >
15
15
<description >
16
- Contains junit-platform.properties in a "use -excludable" way
16
+ Contains junit-platform.properties in a "user -excludable" way
17
17
until https://github.com/junit-team/junit5/issues/2794 is available.
18
18
</description >
19
19
Original file line number Diff line number Diff line change 28
28
<module >junit5-properties</module >
29
29
<module >junit5</module >
30
30
<module >junit5-mockito</module >
31
+ <module >junit5-mockito-config</module >
31
32
<module >junit5-vertx</module >
32
33
<module >amazon-lambda</module >
33
34
<module >arquillian</module >
You can’t perform that action at this time.
0 commit comments