forked from quarkus-qe/quarkus-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test Reactive Rest Client support of dynamic number of query parameters
Reactive Rest Client newly supports ([Quarkus PR 24783](quarkusio/quarkus#24783)) passing a query parameters as a map. This is very useful when user don't know query parameters in advance. Feature details can be found in a [TP here](quarkus-qe/quarkus-test-plans#82). Test covers situation when query parameters are of primitive type, Java class or an array (supported by `MultivaluedMap`) and more than one formal parameter is annotated with `@RestQuery`.
- Loading branch information
1 parent
528fee9
commit 5d592c7
Showing
6 changed files
with
113 additions
and
0 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
23 changes: 23 additions & 0 deletions
23
...ent-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/json/BookIdWrapper.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,23 @@ | ||
package io.quarkus.ts.http.restclient.reactive.json; | ||
|
||
public class BookIdWrapper { | ||
|
||
private final int id; | ||
|
||
public BookIdWrapper(int id) { | ||
this.id = id; | ||
} | ||
|
||
public BookIdWrapper(String id) { | ||
this.id = Integer.parseInt(id); | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return Integer.toString(id); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...nt-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/json/BookRepository.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,23 @@ | ||
package io.quarkus.ts.http.restclient.reactive.json; | ||
|
||
import java.util.Map; | ||
|
||
public class BookRepository { | ||
|
||
private static final Map<Integer, Book> REPO = Map.of( | ||
1, new Book("Title 1", "Author 1"), | ||
2, new Book("Title 2", "Author 2"), | ||
3, new Book("Title 3", "Author 3"), | ||
4, new Book("Title 4", "Author 4"), | ||
5, new Book("Title 5", "Author 5"), | ||
6, new Book("Title 6", "Author 6")); | ||
|
||
public static Book getById(Integer id) { | ||
return REPO.get(id); | ||
} | ||
|
||
public static int count() { | ||
return REPO.size(); | ||
} | ||
|
||
} |
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