Skip to content

Commit

Permalink
Dev UI: Change log stream test to use less common logger
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Kruger <[email protected]>
  • Loading branch information
phillip-kruger committed Jun 29, 2023
1 parent 9ec7ce7 commit 5eb1383
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,28 @@ public void testGetLoggers() throws Exception {
JsonNode getLoggersResponse = super.executeJsonRPCMethod("getLoggers");
Assertions.assertNotNull(getLoggersResponse);
Assertions.assertTrue(getLoggersResponse.isArray());
int size = getLoggersResponse.size();
Assertions.assertTrue(size > 0);
}

@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",
Map.of("loggerName", "io.quarkus.devui.runtime.DevUIWebSocket",
"levelValue", "INFO"));
Assertions.assertNotNull(restoreLogLevelResponse);
Assertions.assertEquals("INFO", restoreLogLevelResponse.get("effectiveLevel").asText());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public JsonNode executeJsonRPCMethod(String methodName) throws Exception {
public JsonNode executeJsonRPCMethod(String methodName, Map<String, String> params) throws Exception {
int id = random.nextInt(Integer.MAX_VALUE);
String request = createJsonRPCRequest(id, methodName, params);
log.info("request = " + request);
log.debug("request = " + request);

Vertx vertx = Vertx.vertx();

Expand Down Expand Up @@ -91,7 +91,7 @@ public JsonNode executeJsonRPCMethod(String methodName, Map<String, String> para
});

JsonNode response = parseJsonRPCResponse(id);
log.info("response = " + response.toPrettyString());
log.debug("response = " + response.toPrettyString());
vertx.close();
return response;
}
Expand Down

0 comments on commit 5eb1383

Please sign in to comment.