-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41779 from mkouba/ws-next-client-only-devui
WebSockets Next: Dev UI fixes
- Loading branch information
Showing
6 changed files
with
88 additions
and
19 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
46 changes: 46 additions & 0 deletions
46
...nt/src/test/java/io/quarkus/websockets/next/test/devmode/NoServerEndpointDevModeTest.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,46 @@ | ||
package io.quarkus.websockets.next.test.devmode; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import jakarta.enterprise.event.Observes; | ||
import jakarta.inject.Inject; | ||
import jakarta.inject.Singleton; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusDevModeTest; | ||
import io.quarkus.websockets.next.BasicWebSocketConnector; | ||
import io.restassured.RestAssured; | ||
import io.vertx.ext.web.Router; | ||
|
||
/** | ||
* Just to make sure the Dev UI is not broken if no server endpoint is defined. | ||
*/ | ||
public class NoServerEndpointDevModeTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusDevModeTest testConfig = new QuarkusDevModeTest() | ||
.withApplicationRoot(root -> root | ||
.addClass(MyBean.class)); | ||
|
||
@Test | ||
public void testConnectorIsInjected() { | ||
assertEquals("1", RestAssured.get("mybeantest").then().statusCode(200).extract().body().asString()); | ||
} | ||
|
||
@Singleton | ||
public static class MyBean { | ||
|
||
@Inject | ||
BasicWebSocketConnector connector; | ||
|
||
void addRoute(@Observes Router router) { | ||
router.get("/mybeantest").handler(rc -> { | ||
rc.end(connector != null ? "1" : "0"); | ||
}); | ||
} | ||
|
||
} | ||
|
||
} |
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