From 45dd9e7004786001cf1817e2a0d6df7c6f16f069 Mon Sep 17 00:00:00 2001 From: Phillip Kruger Date: Thu, 29 Jun 2023 10:43:53 +1000 Subject: [PATCH] Dev UI: Change log stream test to use less common logger Signed-off-by: Phillip Kruger (cherry picked from commit 5eb138341a94b946b4c51c60eb9fd63e62786117) --- .../test/java/io/quarkus/devui/LogstreamTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/LogstreamTest.java b/extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/LogstreamTest.java index 41c7649c9e44f..a8a734b5e5af2 100644 --- a/extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/LogstreamTest.java +++ b/extensions/vertx-http/deployment/src/test/java/io/quarkus/devui/LogstreamTest.java @@ -40,16 +40,24 @@ public void testGetLoggers() throws Exception { @Test public void testUpdateLoggers() throws Exception { // Get the level before - JsonNode getLoggerResponse = super.executeJsonRPCMethod("getLogger", Map.of("loggerName", "io.quarkus")); + JsonNode getLoggerResponse = super.executeJsonRPCMethod("getLogger", + Map.of("loggerName", "io.quarkus.devui.runtime.DevUIWebSocket")); Assertions.assertNotNull(getLoggerResponse); Assertions.assertEquals("INFO", getLoggerResponse.get("effectiveLevel").asText()); // Update the level JsonNode updateLogLevelResponse = super.executeJsonRPCMethod("updateLogLevel", - Map.of("loggerName", "io.quarkus", + Map.of("loggerName", "io.quarkus.devui.runtime.DevUIWebSocket", "levelValue", "DEBUG")); Assertions.assertNotNull(updateLogLevelResponse); Assertions.assertEquals("DEBUG", updateLogLevelResponse.get("effectiveLevel").asText()); + + // Restore the level + JsonNode restoreLogLevelResponse = super.executeJsonRPCMethod("updateLogLevel", + Map.of("loggerName", "io.quarkus.devui.runtime.DevUIWebSocket", + "levelValue", "INFO")); + Assertions.assertNotNull(restoreLogLevelResponse); + Assertions.assertEquals("INFO", restoreLogLevelResponse.get("effectiveLevel").asText()); } private boolean hasStartedLine(Iterator elements) {