Sxnan commented on code in PR #569:
URL: https://github.com/apache/flink-agents/pull/569#discussion_r2944018211
##########
runtime/src/test/java/org/apache/flink/agents/runtime/eventlog/FileEventLoggerTest.java:
##########
@@ -494,6 +495,28 @@ void testDefaultEventFilterBehavior() throws Exception {
assertInstanceOf(OutputEvent.class, outputRecord.getEvent());
}
+ @Test
+ void testPrettyPrintOutputsFormattedJson() throws Exception {
+ // Given - config with prettyPrint enabled
+ config =
+ EventLoggerConfig.builder()
+ .loggerType("file")
+ .property(FileEventLogger.BASE_LOG_DIR_PROPERTY_KEY,
tempDir.toString())
+ .property(AgentConfigOptions.PRETTY_PRINT.getKey(),
true)
+ .build();
+ logger = new FileEventLogger(config);
+
+ logger.open(openParams);
+ InputEvent inputEvent = new InputEvent("test input");
+ logger.append(new EventContext(inputEvent), inputEvent);
+ logger.flush();
+
+ // Then - output should span multiple lines (pretty-printed)
+ Path logFile = getExpectedLogFilePath();
+ String content = Files.readString(logFile);
+ assertTrue(content.contains("\n "), "Pretty-printed JSON should
contain indented lines");
Review Comment:
Should we check the entire JSON output result if it is stable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]