-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26686 from ia3andy/move-rest-codestarts
Move REST codestarts to be catalog dependant (RESTEasy/Reactive, Spring Web)
- Loading branch information
Showing
37 changed files
with
449 additions
and
9 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...estarts/quarkus/extension-codestarts/resteasy-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
...tarts/resteasy-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/} |
19 changes: 19 additions & 0 deletions
19
...c/main/resources/codestarts/quarkus/extension-codestarts/resteasy-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,19 @@ | ||
name: resteasy-codestart | ||
ref: resteasy | ||
type: code | ||
tags: extension-codestart | ||
metadata: | ||
title: RESTEasy JAX-RS | ||
description: Easily start your RESTful Web Services | ||
related-guide-section: https://quarkus.io/guides/getting-started#the-jax-rs-resources | ||
language: | ||
base: | ||
data: | ||
resource: | ||
class-name: GreetingResource | ||
path: "/hello" | ||
response: "Hello RESTEasy" | ||
dependencies: | ||
- io.quarkus:quarkus-resteasy | ||
test-dependencies: | ||
- io.rest-assured:rest-assured |
16 changes: 16 additions & 0 deletions
16
...starts/resteasy-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 javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.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
...steasy-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 | ||
public class {resource.class-name}IT extends {resource.class-name}Test { | ||
// Execute the same tests but in packaged mode. | ||
} |
21 changes: 21 additions & 0 deletions
21
...ts/resteasy-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,21 @@ | ||
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 | ||
public class {resource.class-name}Test { | ||
|
||
@Test | ||
public void testHelloEndpoint() { | ||
given() | ||
.when().get("{resource.path}") | ||
.then() | ||
.statusCode(200) | ||
.body(is("{resource.response}")); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
...arts/resteasy-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 javax.ws.rs.GET | ||
import javax.ws.rs.Path | ||
import javax.ws.rs.Produces | ||
import javax.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
...easy-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
.../resteasy-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
...rts/resteasy-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 javax.ws.rs.\{GET, Path, Produces} | ||
import javax.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
...asy-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
...resteasy-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}")) | ||
} | ||
|
||
} |
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/} |
19 changes: 19 additions & 0 deletions
19
...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,19 @@ | ||
name: resteasy-reactive-codestart | ||
ref: resteasy-reactive | ||
type: code | ||
tags: extension-codestart | ||
metadata: | ||
title: RESTEasy Reactive | ||
description: Easily start your Reactive RESTful 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 RESTEasy Reactive" | ||
dependencies: | ||
- io.quarkus:quarkus-resteasy-reactive | ||
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 javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.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 | ||
public class {resource.class-name}IT extends {resource.class-name}Test { | ||
// Execute the same tests but in packaged mode. | ||
} |
21 changes: 21 additions & 0 deletions
21
...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,21 @@ | ||
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 | ||
public class {resource.class-name}Test { | ||
|
||
@Test | ||
public 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 javax.ws.rs.GET | ||
import javax.ws.rs.Path | ||
import javax.ws.rs.Produces | ||
import javax.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 javax.ws.rs.\{GET, Path, Produces} | ||
import javax.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}")) | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...tarts/quarkus/extension-codestarts/spring-web-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
...rts/spring-web-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/} |
21 changes: 21 additions & 0 deletions
21
...main/resources/codestarts/quarkus/extension-codestarts/spring-web-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,21 @@ | ||
name: spring-web-codestart | ||
ref: spring-web | ||
type: code | ||
tags: extension-codestart | ||
metadata: | ||
title: Spring Web | ||
description: Spring, the Quarkus way! Start your RESTful Web Services with a Spring Controller. | ||
related-guide-section: https://quarkus.io/guides/spring-web#greetingcontroller | ||
language: | ||
base: | ||
data: | ||
resource: | ||
class-name: GreetingController | ||
path: "/greeting" | ||
response: "Hello Spring" | ||
package-name: org.acme | ||
dependencies: | ||
- io.quarkus:quarkus-spring-web | ||
- io.quarkus:quarkus-resteasy-reactive-jackson | ||
test-dependencies: | ||
- io.rest-assured:rest-assured |
15 changes: 15 additions & 0 deletions
15
...arts/spring-web-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,15 @@ | ||
package org.acme; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("{resource.path}") | ||
public class {resource.class-name} { | ||
|
||
@GetMapping | ||
public String hello() { | ||
return "{resource.response}"; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ng-web-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 | ||
public class {resource.class-name}IT extends {resource.class-name}Test { | ||
// Execute the same tests but in packaged mode. | ||
} |
Oops, something went wrong.