-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: additional Vert.x clean up and increase scenario coverage
Signed-off-by: Michael Edgar <[email protected]>
- Loading branch information
Showing
7 changed files
with
80 additions
and
77 deletions.
There are no files selected for viewing
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
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
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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse; | ||
|
||
import io.quarkus.vertx.web.Body; | ||
import io.quarkus.vertx.web.Header; | ||
import io.quarkus.vertx.web.Route; | ||
import io.quarkus.vertx.web.Route.HttpMethod; | ||
import io.quarkus.vertx.web.RouteBase; | ||
|
@@ -20,7 +21,7 @@ | |
* @author Phillip Kruger ([email protected]) | ||
*/ | ||
@ApplicationScoped | ||
@RouteBase(path = "greeting", consumes = "application/json", produces = "application/json") | ||
@RouteBase(path = "greeting/", consumes = "application/json", produces = "application/json") | ||
public class GreetingPostRoute { | ||
|
||
// 1) Basic path var test | ||
|
@@ -36,4 +37,9 @@ public void greetWithResponse(@Body Greeting greeting) { | |
// | ||
} | ||
|
||
// 3) Header parameter | ||
@Route(path = "/greetWithHeader", methods = HttpMethod.POST) | ||
public Greeting greetWithResponse(@Body Greeting greeting, @Header String language) { | ||
return greeting; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -21,17 +21,18 @@ | |
* @author Phillip Kruger ([email protected]) | ||
*/ | ||
@ApplicationScoped | ||
@RouteBase(path = "greeting", consumes = "application/json", produces = "application/json") | ||
// `path` not specified on @RouteBase | ||
@RouteBase(consumes = "application/json", produces = "application/json") | ||
public class GreetingPutRoute { | ||
|
||
// 1) Basic path var test | ||
@Route(path = "/greet/:id", methods = HttpMethod.PUT) | ||
@Route(path = "/greeting/greet/:id", methods = HttpMethod.PUT) | ||
public Greeting greet(@Body Greeting greeting, @Param("id") String id) { | ||
return greeting; | ||
} | ||
|
||
// 2) Void, so without a type specified | ||
@Route(path = "/greetWithResponse/:id", methods = HttpMethod.PUT) | ||
@Route(path = "/greeting/greetWithResponse/:id", methods = HttpMethod.PUT) | ||
@APIResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(ref = "#/components/schemas/Greeting"))) | ||
public void greetWithResponse(@Body Greeting greeting, @Param("id") String id) { | ||
// | ||
|
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
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