Skip to content

Commit 54865b4

Browse files
authored
Merge pull request #46793 from holly-cummins/mockito-reproducer
Add disabled reproducer for mockito mocking inner classes in continuous testing
2 parents 0961d5a + 87440c4 commit 54865b4

File tree

9 files changed

+394
-0
lines changed

9 files changed

+394
-0
lines changed

integration-tests/maven/src/test/java/io/quarkus/maven/it/DevMojoIT.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,21 @@ public void testPropertyExpansion() throws IOException, MavenInvocationException
14521452
assertThat(devModeClient.getHttpResponse("/app/hello/applicationName")).isEqualTo("myapp");
14531453
}
14541454

1455+
@Disabled("See https://github.com/quarkusio/quarkus/issues/38987")
1456+
@Test
1457+
public void testMockitoForNonPublicInnerClass() throws MavenInvocationException, IOException {
1458+
// Scenario discussed in https://github.com/quarkusio/quarkus/issues/38987
1459+
testDir = initProject("projects/mockito-non-public-inner-class", "projects/mockito-non-public-inner-class-out");
1460+
runAndCheck();
1461+
1462+
ContinuousTestingMavenTestUtils testingTestUtils = new ContinuousTestingMavenTestUtils();
1463+
ContinuousTestingMavenTestUtils.TestStatus results = testingTestUtils.waitForNextCompletion();
1464+
1465+
//check that the tests ran green
1466+
Assertions.assertEquals(0, results.getTestsFailed());
1467+
Assertions.assertEquals(1, results.getTestsPassed());
1468+
}
1469+
14551470
@Test
14561471
public void testMultiJarModuleDevModeMocks() throws MavenInvocationException, IOException {
14571472
testDir = initProject("projects/multijar-module", "projects/multijar-module-devmode-mocks");
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#Maven
2+
target/
3+
pom.xml.tag
4+
pom.xml.releaseBackup
5+
pom.xml.versionsBackup
6+
release.properties
7+
.flattened-pom.xml
8+
9+
# Eclipse
10+
.project
11+
.classpath
12+
.settings/
13+
bin/
14+
15+
# IntelliJ
16+
.idea
17+
*.ipr
18+
*.iml
19+
*.iws
20+
21+
# NetBeans
22+
nb-configuration.xml
23+
24+
# Visual Studio Code
25+
.vscode
26+
.factorypath
27+
28+
# OSX
29+
.DS_Store
30+
31+
# Vim
32+
*.swp
33+
*.swo
34+
35+
# patch
36+
*.orig
37+
*.rej
38+
39+
# Local environment
40+
.env
41+
42+
# Plugin directory
43+
/.quarkus/cli/plugins/
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?xml version="1.0"?>
2+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>org.acme</groupId>
6+
<artifactId>code-with-quarkus</artifactId>
7+
<version>1.0.0-SNAPSHOT</version>
8+
<properties>
9+
<compiler-plugin.version>3.12.1</compiler-plugin.version>
10+
<maven.compiler.release>17</maven.compiler.release>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
13+
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
14+
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
15+
<quarkus.platform.version>@project.version@</quarkus.platform.version>
16+
<skipITs>true</skipITs>
17+
<surefire-plugin.version>3.2.5</surefire-plugin.version>
18+
</properties>
19+
<dependencyManagement>
20+
<dependencies>
21+
<dependency>
22+
<groupId>${quarkus.platform.group-id}</groupId>
23+
<artifactId>${quarkus.platform.artifact-id}</artifactId>
24+
<version>${quarkus.platform.version}</version>
25+
<type>pom</type>
26+
<scope>import</scope>
27+
</dependency>
28+
</dependencies>
29+
</dependencyManagement>
30+
<dependencies>
31+
<dependency>
32+
<groupId>io.quarkus</groupId>
33+
<artifactId>quarkus-arc</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>io.quarkus</groupId>
37+
<artifactId>quarkus-rest</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>io.quarkus</groupId>
41+
<artifactId>quarkus-junit5-mockito</artifactId>
42+
<scope>test</scope>
43+
</dependency>
44+
</dependencies>
45+
<build>
46+
<plugins>
47+
<plugin>
48+
<groupId>${quarkus.platform.group-id}</groupId>
49+
<artifactId>quarkus-maven-plugin</artifactId>
50+
<version>${quarkus.platform.version}</version>
51+
<extensions>true</extensions>
52+
<executions>
53+
<execution>
54+
<goals>
55+
<goal>build</goal>
56+
<goal>generate-code</goal>
57+
<goal>generate-code-tests</goal>
58+
</goals>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
<plugin>
63+
<artifactId>maven-compiler-plugin</artifactId>
64+
<version>${compiler-plugin.version}</version>
65+
<configuration>
66+
<compilerArgs>
67+
<arg>-parameters</arg>
68+
</compilerArgs>
69+
</configuration>
70+
</plugin>
71+
<plugin>
72+
<artifactId>maven-surefire-plugin</artifactId>
73+
<version>${surefire-plugin.version}</version>
74+
<configuration>
75+
<systemPropertyVariables>
76+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
77+
<maven.home>${maven.home}</maven.home>
78+
</systemPropertyVariables>
79+
</configuration>
80+
</plugin>
81+
<plugin>
82+
<artifactId>maven-failsafe-plugin</artifactId>
83+
<version>${surefire-plugin.version}</version>
84+
<executions>
85+
<execution>
86+
<goals>
87+
<goal>integration-test</goal>
88+
<goal>verify</goal>
89+
</goals>
90+
</execution>
91+
</executions>
92+
<configuration>
93+
<systemPropertyVariables>
94+
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
95+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
96+
<maven.home>${maven.home}</maven.home>
97+
</systemPropertyVariables>
98+
</configuration>
99+
</plugin>
100+
</plugins>
101+
</build>
102+
<profiles>
103+
<profile>
104+
<id>native</id>
105+
<activation>
106+
<property>
107+
<name>native</name>
108+
</property>
109+
</activation>
110+
<properties>
111+
<skipITs>false</skipITs>
112+
<quarkus.package.type>native</quarkus.package.type>
113+
</properties>
114+
</profile>
115+
</profiles>
116+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.acme;
2+
3+
public class Foo {
4+
5+
static class Inner {
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.acme;
2+
3+
import jakarta.ws.rs.GET;
4+
import jakarta.ws.rs.Path;
5+
import jakarta.ws.rs.Produces;
6+
import jakarta.ws.rs.core.MediaType;
7+
8+
@Path("/hello")
9+
public class HelloResource {
10+
11+
@GET
12+
@Produces(MediaType.TEXT_PLAIN)
13+
public String hello() {
14+
return "hello";
15+
}
16+
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.acme;
2+
3+
import jakarta.ws.rs.ApplicationPath;
4+
import jakarta.ws.rs.core.Application;
5+
6+
@ApplicationPath("/app")
7+
public class MyApplication extends Application {
8+
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>org.acme - 1.0-SNAPSHOT</title>
6+
<style>
7+
h1, h2, h3, h4, h5, h6 {
8+
margin-bottom: 0.5rem;
9+
font-weight: 400;
10+
line-height: 1.5;
11+
}
12+
13+
h1 {
14+
font-size: 2.5rem;
15+
}
16+
17+
h2 {
18+
font-size: 2rem
19+
}
20+
21+
h3 {
22+
font-size: 1.75rem
23+
}
24+
25+
h4 {
26+
font-size: 1.5rem
27+
}
28+
29+
h5 {
30+
font-size: 1.25rem
31+
}
32+
33+
h6 {
34+
font-size: 1rem
35+
}
36+
37+
.lead {
38+
font-weight: 300;
39+
font-size: 2rem;
40+
}
41+
42+
.banner {
43+
font-size: 2.7rem;
44+
margin: 0;
45+
padding: 2rem 1rem;
46+
background-color: #00A1E2;
47+
color: white;
48+
}
49+
50+
body {
51+
margin: 0;
52+
font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
53+
}
54+
55+
code {
56+
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
57+
font-size: 87.5%;
58+
color: #e83e8c;
59+
word-break: break-word;
60+
}
61+
62+
.left-column {
63+
padding: .75rem;
64+
max-width: 75%;
65+
min-width: 55%;
66+
}
67+
68+
.right-column {
69+
padding: .75rem;
70+
max-width: 25%;
71+
}
72+
73+
.container {
74+
display: flex;
75+
width: 100%;
76+
}
77+
78+
li {
79+
margin: 0.75rem;
80+
}
81+
82+
.right-section {
83+
margin-left: 1rem;
84+
padding-left: 0.5rem;
85+
}
86+
87+
.right-section h3 {
88+
padding-top: 0;
89+
font-weight: 200;
90+
}
91+
92+
.right-section ul {
93+
border-left: 0.3rem solid #00A1E2;
94+
list-style-type: none;
95+
padding-left: 0;
96+
}
97+
98+
</style>
99+
</head>
100+
<body>
101+
102+
<div class="banner lead">
103+
Your new Cloud-Native application is ready!
104+
</div>
105+
106+
<div class="container">
107+
<div class="left-column">
108+
<p class="lead"> Congratulations, you have created a new Quarkus application.</p>
109+
110+
<h2>Why do you see this?</h2>
111+
112+
<p>This page is served by Quarkus. The source is in
113+
<code>src/main/resources/META-INF/resources/index.html</code>.</p>
114+
115+
<h2>What can I do from here?</h2>
116+
117+
<p>If not already done, run the application in <em>dev mode</em> using: <code>mvn quarkus:dev</code>.
118+
</p>
119+
<ul>
120+
<li>Add REST resources, Servlets, functions and other services in <code>src/main/java</code>.</li>
121+
<li>Your static assets are located in <code>src/main/resources/META-INF/resources</code>.</li>
122+
<li>Configure your application in <code>src/main/resources/application.properties</code>.
123+
</li>
124+
</ul>
125+
126+
<h2>Do you like Quarkus?</h2>
127+
<p>Go give it a star on <a href="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/quarkusio/quarkus">GitHub</a>.</p>
128+
129+
<h2>How do I get rid of this page?</h2>
130+
<p>Just delete the <code>src/main/resources/META-INF/resources/index.html</code> file.</p>
131+
</div>
132+
<div class="right-column">
133+
<div class="right-section">
134+
<h3>Application</h3>
135+
<ul>
136+
<li>GroupId: org.acme</li>
137+
<li>ArtifactId: acme</li>
138+
<li>Version: 1.0-SNAPSHOT</li>
139+
<li>Quarkus Version: 999-SNAPSHOT</li>
140+
</ul>
141+
</div>
142+
<div class="right-section">
143+
<h3>Next steps</h3>
144+
<ul>
145+
<!-- the url have been erased on purpose -->
146+
<li><a href="#">Setup your IDE</a></li>
147+
<li><a href="#">Getting started</a></li>
148+
<li><a href="#">Documentation</a></li>
149+
</ul>
150+
</div>
151+
</div>
152+
</div>
153+
154+
155+
</body>
156+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
quarkus.test.continuous-testing=enabled

0 commit comments

Comments
 (0)