Skip to content

Commit 0de6c1e

Browse files
holly-cumminsgeoand
authored andcommitted
Add tests for multimodule scenario
1 parent 974e196 commit 0de6c1e

File tree

11 files changed

+319
-0
lines changed

11 files changed

+319
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
group 'org.acme'
2+
version '1.0.0-SNAPSHOT'
3+
4+
allprojects {
5+
repositories {
6+
mavenCentral()
7+
mavenLocal()
8+
}
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Gradle properties
2+
3+
quarkusPluginVersion=${project.version}
4+
quarkusPlatformArtifactId=quarkus-bom
5+
quarkusPluginId=io.quarkus
6+
quarkusPlatformGroupId=io.quarkus
7+
quarkusPlatformVersion=${project.version}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
plugins {
2+
`java-library`
3+
}
4+
5+
repositories {
6+
}
7+
8+
val quarkusPlatformGroupId: String by project
9+
val quarkusPlatformArtifactId: String by project
10+
val quarkusPlatformVersion: String by project
11+
12+
dependencies {
13+
"implementation"(enforcedPlatform("$quarkusPlatformGroupId:$quarkusPlatformArtifactId:$quarkusPlatformVersion"))
14+
implementation("io.quarkus:quarkus-rest")
15+
testImplementation("io.quarkus:quarkus-junit5")
16+
testImplementation("io.rest-assured:rest-assured")
17+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
public class Blank {
2+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
quarkus.test.continuous-testing=enabled
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>code-with-quarkus - 1.0.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+
26+
h4 {
27+
font-size: 1.5rem
28+
}
29+
30+
h5 {
31+
font-size: 1.25rem
32+
}
33+
34+
h6 {
35+
font-size: 1rem
36+
}
37+
38+
.lead {
39+
font-weight: 300;
40+
font-size: 2rem;
41+
}
42+
43+
.banner {
44+
font-size: 2.7rem;
45+
margin: 0;
46+
padding: 2rem 1rem;
47+
background-color: #0d1c2c;
48+
color: white;
49+
}
50+
51+
body {
52+
margin: 0;
53+
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";
54+
}
55+
56+
code {
57+
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
58+
font-size: 87.5%;
59+
color: #e83e8c;
60+
word-break: break-word;
61+
}
62+
63+
.left-column {
64+
padding: .75rem;
65+
max-width: 75%;
66+
min-width: 55%;
67+
}
68+
69+
.right-column {
70+
padding: .75rem;
71+
max-width: 25%;
72+
}
73+
74+
.container {
75+
display: flex;
76+
width: 100%;
77+
}
78+
79+
li {
80+
margin: 0.75rem;
81+
}
82+
83+
.right-section {
84+
margin-left: 1rem;
85+
padding-left: 0.5rem;
86+
}
87+
88+
.right-section h3 {
89+
padding-top: 0;
90+
font-weight: 200;
91+
}
92+
93+
.right-section ul {
94+
border-left: 0.3rem solid #71aeef;
95+
list-style-type: none;
96+
padding-left: 0;
97+
}
98+
99+
.example-code {
100+
border-left: 0.3rem solid #71aeef;
101+
padding-left: 10px;
102+
}
103+
104+
.example-code h3 {
105+
font-weight: 200;
106+
}
107+
</style>
108+
</head>
109+
<body>
110+
111+
<div class="banner lead">
112+
Your new Cloud-Native application is ready!
113+
</div>
114+
115+
<div class="container">
116+
<div class="left-column">
117+
<p class="lead"> Congratulations, you have created a new Quarkus cloud application.</p>
118+
119+
<h2>What is this page?</h2>
120+
121+
<p>This page is served by Quarkus. The source is in
122+
<code>src/main/resources/META-INF/resources/index.html</code>.</p>
123+
124+
<h2>What are your next steps?</h2>
125+
126+
<p>If not already done, run the application in <em>dev mode</em> using: <code>./gradlew quarkusDev</code>.
127+
</p>
128+
<ul>
129+
<li>Your static assets are located in <code>src/main/resources/META-INF/resources</code>.</li>
130+
<li>Configure your application in <code>src/main/resources/application.properties</code>.</li>
131+
<li>Quarkus now ships with a <a href="/q/dev/">Dev UI</a> (available in dev mode only)</li>
132+
<li>Play with the getting started example code located in <code>src/main/java</code>:</li>
133+
</ul>
134+
<div class="example-code">
135+
<h3>RESTEasy JAX-RS example</h3>
136+
<p>REST is easy peasy with this Hello World RESTEasy resource.</p>
137+
<p><code>@Path: <a href="/hello-resteasy" class="path-link" target="_blank">/hello-resteasy</a></code></p>
138+
<p><a href="https://quarkus.io/guides/getting-started#the-jax-rs-resources" class="guide-link" target="_blank">Related guide section...</a></p>
139+
</div>
140+
<div class="example-code">
141+
<h3>RESTEasy JSON serialisation using Jackson</h3>
142+
<p>This example demonstrate RESTEasy JSON serialisation by letting you list, add and remove quark types from a list. Quarked!</p>
143+
<p><code>@Path: <a href="/resteasy-jackson/quarks/" class="path-link" target="_blank">/resteasy-jackson/quarks/</a></code></p>
144+
<p><a href="https://quarkus.io/guides/rest-json#creating-your-first-json-rest-service" class="guide-link" target="_blank">Related guide section...</a></p>
145+
</div>
146+
147+
</div>
148+
<div class="right-column">
149+
<div class="right-section">
150+
<h3>Application</h3>
151+
<ul>
152+
<li>GroupId: <code>org.acme</code></li>
153+
<li>ArtifactId: <code>code-with-quarkus</code></li>
154+
<li>Version: <code>1.0.0-SNAPSHOT</code></li>
155+
<li>Quarkus Version: <code>1.12.2.Final</code></li>
156+
</ul>
157+
</div>
158+
<div class="right-section">
159+
<h3>Do you like Quarkus?</h3>
160+
<ul>
161+
<li>Go give it a star on <a href="https://github.com/quarkusio/quarkus">GitHub</a>.</li>
162+
</ul>
163+
</div>
164+
<div class="right-section">
165+
<h3>Selected extensions guides</h3>
166+
<ul>
167+
<li title="REST endpoint framework implementing JAX-RS and more"><a href="https://quarkus.io/guides/rest-json" target="_blank">RESTEasy JAX-RS guide</a></li>
168+
</ul>
169+
</div>
170+
<div class="right-section">
171+
<h3>More reading</h3>
172+
<ul>
173+
<li><a href="https://quarkus.io/guides/gradle-tooling" target="_blank">Setup your IDE</a></li>
174+
<li><a href="https://quarkus.io/guides/getting-started" target="_blank">Getting started</a></li>
175+
<li><a href="https://quarkus.io/guides/" target="_blank">All guides</a></li>
176+
<li><a href="https://quarkus.io" target="_blank">Quarkus Web Site</a></li>
177+
</ul>
178+
</div>
179+
</div>
180+
</div>
181+
</body>
182+
</html>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
`java-library`
3+
id("io.quarkus")
4+
5+
}
6+
7+
repositories {
8+
}
9+
10+
val quarkusPlatformGroupId: String by project
11+
val quarkusPlatformArtifactId: String by project
12+
val quarkusPlatformVersion: String by project
13+
14+
dependencies {
15+
"implementation"(enforcedPlatform("$quarkusPlatformGroupId:$quarkusPlatformArtifactId:$quarkusPlatformVersion"))
16+
17+
implementation("io.quarkus:quarkus-rest")
18+
testImplementation("io.quarkus:quarkus-junit5")
19+
testImplementation("io.rest-assured:rest-assured")
20+
implementation(project(":lib-mod"))
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 SomeResource {
10+
11+
@GET
12+
@Produces(MediaType.TEXT_PLAIN)
13+
public String hello() {
14+
return "baz flib";
15+
}
16+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.acme;
2+
3+
import static io.restassured.RestAssured.given;
4+
import static org.hamcrest.CoreMatchers.is;
5+
6+
import org.junit.jupiter.api.Test;
7+
8+
import io.quarkus.test.junit.QuarkusTest;
9+
10+
@QuarkusTest
11+
public class GreetingResourceTest {
12+
13+
@Test
14+
public void testHelloEndpoint() {
15+
given()
16+
.when().get("/hello")
17+
.then()
18+
.statusCode(200)
19+
.body(is("baz flib"));
20+
}
21+
22+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
pluginManagement {
2+
repositories {
3+
mavenCentral()
4+
gradlePluginPortal()
5+
mavenLocal()
6+
}
7+
plugins {
8+
id "${quarkusPluginId}" version "${quarkusPluginVersion}"
9+
}
10+
}
11+
rootProject.name = 'code-with-quarkus'
12+
13+
include 'main-mod'
14+
15+
include 'lib-mod'

0 commit comments

Comments
 (0)