-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebClient used in SE examples and tests #1646
Conversation
@romain-grecourt can you please have a look?
|
I was thinking about some WebClient wrapper for Helidon tests. Because when you look into the PR, it contains a lot of duplicity code ... What I am struggling with currently is, how to make it as simple as possible. |
Perhaps some of these simplications should be offered to developers as well (if not already there!). E.g., if I want to add JSON support, why can't I do that in a single line with reasonable defaults?
or something similar. CoC can coexist with the no magic style. |
Yes I definitely agree that some simplification for users is required also.
|
I agree that MediaSupport needs a way to replicate the current "media support" services. Shortcut methods on the builder for registering readers and writer also sounds like a good idea. Also E.g. MediaSupport.create() // MediaSupport with defaults
MediaSupport.builder(false) // does not register defaults
.reader(FooReader.create()) // shortcut for .readerContext().registerReader(...)
MediaSupport.builder() // registers defaults
.operators(JsonMediaSupport.create()) // registers all supported operators for JSON |
Having that as part of the |
WebSecurityTestUtil.stopServer(server); | ||
} | ||
|
||
abstract String serverBaseUri(); | ||
|
||
@Test | ||
void basicTestJohn() { | ||
void basicTestJohn() throws ExecutionException, InterruptedException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe these could be changed to just throws Exception
? Or maybe like Tomas said we need to come-up with a small utility and wrap the exceptions.
Maybe something like utility method await to hide dirty blocking? Its quite common in reactive tcks: WebClientResponse response = await(webClient.get()
.path("/employees")
.request());
response.close();
Assertions.assertEquals(Http.Status.OK_200, response.status(), "HTTP response2"); I would definitely add some timeout |
9a08ddc
to
f8d10b9
Compare
Fixes #1668 |
@tomas-langer Can this PR go in without the new |
examples/employee-app/src/test/java/io/helidon/service/employee/MainTest.java
Show resolved
Hide resolved
examples/employee-app/src/test/java/io/helidon/service/employee/MainTest.java
Show resolved
Hide resolved
...security-outbound/src/main/java/io/helidon/grpc/examples/security/outbound/SecureServer.java
Outdated
Show resolved
Hide resolved
webserver/webserver/src/test/java/io/helidon/webserver/Status204Test.java
Show resolved
Hide resolved
9ecc5d3
to
440372f
Compare
Signed-off-by: David Kral <david.k.kral@oracle.com>
Signed-off-by: David Kral <david.k.kral@oracle.com>
Signed-off-by: David Kral <david.k.kral@oracle.com>
Signed-off-by: David Kral <david.k.kral@oracle.com>
440372f
to
1f6c812
Compare
Follow up: #1748 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: David Kral david.k.kral@oracle.com