Skip to content
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

4.x: Testing story #5410

Open
2 of 5 tasks
tomas-langer opened this issue Nov 14, 2022 · 0 comments
Open
2 of 5 tasks

4.x: Testing story #5410

tomas-langer opened this issue Nov 14, 2022 · 0 comments
Assignees
Labels
Milestone

Comments

@tomas-langer
Copy link
Member

tomas-langer commented Nov 14, 2022

We have support for HTTP/1
Need similar support for:

Currently Helidon 4 supports unit tests and integration tests using @ServerTest and @RoutingTest. The JUnit extension adds support for injection of Http1Client (for server test) and DirectClient (for unit tests, also implements Http1Client but bypasses HTTP protocol and directly invokes routing).

This issue is to add similar support for other protocols. Both @ServerTest and @RoutingTest should be applicable to any protocol testing.
The following should be added:

  • support for routing using the protocol specific routing type (e.g. for WebSocket, it would be WebSocketRouting), now we support HttpRouting and Router.Builder (second can be used to configure any routing, but only works with @ServerTest)
  • support for injecting client for other protocols that is pre-configured for the correct host and port (@ServerTest)
  • support for injecting a direct client for other protocols that invokes routing directly and bypasses socket communication (for @RoutingTest)
  • all of this should be done in a modularized way - e.g. you only want to support WebSocket if websocket is on classpath (or add a specific web socket testing module), but only use a single JUnit extension (so we can reuse the exact same annotations for all protocols)

Example of a test I want to be able to define:

@ServerTest
class MyHttp2IT {
  private final Http2Client client;
  MyHttp2IT(Http2Client client) {
    this.client = client;
  }
 
}
@RoutingTest
class MyHttp2Test {
  private final Http2DirectClient client;
  MyHttp2Test(Http2DirectClient client) {
    this.client = client;
  } 
}
@ServerTest
class MyWebsocketIT {
  private final WebSocketClient client; // we do not have a websocket client yet, this is the concept
  MyHttp2IT(WebSocketClient client) {
    this.client = client;
  }
  @SetUpRoute
  void routing(WebSocketRouting.Builder routing) {
    ...
  }
}
@RoutingTest
class MyWebSocketTest {
  private final DirectWebSocketClient client; // we do not have a websocket client yet, this is the concept
  MyHttp2IT(DirectWebSocketClient client) {
    this.client = client;
  }
  @SetUpRoute
  void routing(WebSocketRouting.Builder routing) {
    ...
  }
@tomas-langer tomas-langer changed the title Testing story - good for HTTP/1, need the same for HTTP/2, gRPC, graphQL, Security, WebSocket Nima Testing story Nov 14, 2022
@tomas-langer tomas-langer changed the title Nima Testing story Nima: Testing story Nov 14, 2022
@tomas-langer tomas-langer added testing 4.x Version 4.x labels Nov 14, 2022
@tomas-langer tomas-langer added this to the 4.0.0 milestone Nov 14, 2022
@tomas-langer tomas-langer self-assigned this Dec 14, 2022
@barchetta barchetta modified the milestones: 4.0.0, 4.0.0-RC1 Jan 18, 2023
@m0mus m0mus modified the milestones: 4.0.0-M2, 4.0.0 Jul 24, 2023
@tomas-langer tomas-langer modified the milestones: 4.0.0, 4.x Sep 6, 2023
@tomas-langer tomas-langer changed the title Nima: Testing story 4.x: Testing story Aug 15, 2024
@edbratt edbratt modified the milestones: 4.x, 5.x Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Legendary
Development

No branches or pull requests

4 participants