Testing Method structure
This commit is contained in:
@@ -7,6 +7,7 @@ import dev.selimaj.session.types.Message;
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.WebSocket;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public final class Session {
|
||||
|
||||
@@ -45,6 +46,13 @@ public final class Session {
|
||||
listener.notify(ws, method, data);
|
||||
}
|
||||
|
||||
public <Req, Res> CompletableFuture<Res> request(
|
||||
String method,
|
||||
Req data,
|
||||
Class<Res> resType) throws Exception {
|
||||
return listener.request(ws, method, data, resType);
|
||||
}
|
||||
|
||||
public void close() throws Exception {
|
||||
ws.sendClose(0, "Session closed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user