-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix codestarts compatibility with older CLI
- Loading branch information
Showing
12 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...uarkus/extension-codestarts/resteasy-reactive-codestart/base/README.tpl.qute.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{#include readme-header /} |
1 change: 1 addition & 0 deletions
1
...teasy-reactive-codestart/base/src/main/resources/META-INF/resources/index.entry.qute.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{#include index-entry path=resource.path/} |
20 changes: 20 additions & 0 deletions
20
...sources/codestarts/quarkus/extension-codestarts/resteasy-reactive-codestart/codestart.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# We need this for compat with older CLI versions | ||
name: resteasy-reactive-codestart | ||
ref: resteasy-reactive | ||
type: code | ||
tags: extension-codestart | ||
metadata: | ||
title: REST | ||
description: Easily start your REST Web Services | ||
related-guide-section: https://quarkus.io/guides/getting-started-reactive#reactive-jax-rs-resources | ||
language: | ||
base: | ||
data: | ||
resource: | ||
class-name: GreetingResource | ||
path: "/hello" | ||
response: "Hello from Quarkus REST" | ||
dependencies: | ||
- io.quarkus:quarkus-rest | ||
test-dependencies: | ||
- io.rest-assured:rest-assured |
16 changes: 16 additions & 0 deletions
16
...steasy-reactive-codestart/java/src/main/java/org/acme/{resource.class-name}.tpl.qute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.acme; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
|
||
@Path("{resource.path}") | ||
public class {resource.class-name} { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String hello() { | ||
return "{resource.response}"; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...active-codestart/java/src/native-test/java/org/acme/{resource.class-name}IT.tpl.qute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest; | ||
|
||
@QuarkusIntegrationTest | ||
class {resource.class-name}IT extends {resource.class-name}Test { | ||
// Execute the same tests but in packaged mode. | ||
} |
20 changes: 20 additions & 0 deletions
20
...sy-reactive-codestart/java/src/test/java/org/acme/{resource.class-name}Test.tpl.qute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.acme; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.is; | ||
|
||
@QuarkusTest | ||
class {resource.class-name}Test { | ||
@Test | ||
void testHelloEndpoint() { | ||
given() | ||
.when().get("{resource.path}") | ||
.then() | ||
.statusCode(200) | ||
.body(is("{resource.response}")); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
...easy-reactive-codestart/kotlin/src/main/kotlin/org/acme/{resource.class-name}.tpl.qute.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.acme | ||
|
||
import jakarta.ws.rs.GET | ||
import jakarta.ws.rs.Path | ||
import jakarta.ws.rs.Produces | ||
import jakarta.ws.rs.core.MediaType | ||
|
||
@Path("{resource.path}") | ||
class {resource.class-name} { | ||
|
||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
fun hello() = "{resource.response}" | ||
} |
6 changes: 6 additions & 0 deletions
6
...tive-codestart/kotlin/src/native-test/kotlin/org/acme/{resource.class-name}IT.tpl.qute.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.acme | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest | ||
|
||
@QuarkusIntegrationTest | ||
class {resource.class-name}IT : {resource.class-name}Test() |
20 changes: 20 additions & 0 deletions
20
...-reactive-codestart/kotlin/src/test/kotlin/org/acme/{resource.class-name}Test.tpl.qute.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.acme | ||
|
||
import io.quarkus.test.junit.QuarkusTest | ||
import io.restassured.RestAssured.given | ||
import org.hamcrest.CoreMatchers.`is` | ||
import org.junit.jupiter.api.Test | ||
|
||
@QuarkusTest | ||
class {resource.class-name}Test { | ||
|
||
@Test | ||
fun testHelloEndpoint() { | ||
given() | ||
.`when`().get("{resource.path}") | ||
.then() | ||
.statusCode(200) | ||
.body(`is`("{resource.response}")) | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...asy-reactive-codestart/scala/src/main/scala/org/acme/{resource.class-name}.tpl.qute.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.acme | ||
|
||
import jakarta.ws.rs.\{GET, Path, Produces} | ||
import jakarta.ws.rs.core.MediaType | ||
|
||
@Path("{resource.path}") | ||
class {resource.class-name} { | ||
|
||
@GET | ||
@Produces(Array[String](MediaType.TEXT_PLAIN)) | ||
def hello() = "{resource.response}" | ||
} |
6 changes: 6 additions & 0 deletions
6
...ive-codestart/scala/src/native-test/scala/org/acme/{resource.class-name}IT.tpl.qute.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.acme | ||
|
||
import io.quarkus.test.junit.QuarkusIntegrationTest | ||
|
||
@QuarkusIntegrationTest | ||
class {resource.class-name}IT extends {resource.class-name}Test |
20 changes: 20 additions & 0 deletions
20
...reactive-codestart/scala/src/test/scala/org/acme/{resource.class-name}Test.tpl.qute.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.acme | ||
|
||
import io.quarkus.test.junit.QuarkusTest | ||
import io.restassured.RestAssured.given | ||
import org.hamcrest.CoreMatchers.`is` | ||
import org.junit.jupiter.api.Test | ||
|
||
@QuarkusTest | ||
class {resource.class-name}Test { | ||
|
||
@Test | ||
def testHelloEndpoint() = { | ||
given() | ||
.`when`().get("{resource.path}") | ||
.then() | ||
.statusCode(200) | ||
.body(`is`("{resource.response}")) | ||
} | ||
|
||
} |