pjfanning commented on code in PR #1187:
URL: https://github.com/apache/poi/pull/1187#discussion_r3615761345


##########
poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFGroupShape.java:
##########
@@ -86,6 +95,38 @@ void testCreateShapes() throws Exception {
         }
     }
 
+    @Test
+    void testCreatingShapeInGroupDoesNotWarnAboutReusedShapeIds() throws 
Exception {
+        List<String> capturedWarnings = new ArrayList<>();
+        LoggerContext loggerContext = (LoggerContext) 
LogManager.getContext(false);
+        Configuration config = loggerContext.getConfiguration();
+        Appender captureAppender = new AbstractAppender("capture-for-test", 
null, null, false, null) {
+            @Override
+            public void append(LogEvent event) {
+                capturedWarnings.add(event.getMessage().getFormattedMessage());
+            }
+        };
+        captureAppender.start();
+        config.addAppender(captureAppender);
+        config.getRootLogger().addAppender(captureAppender, Level.WARN, null);
+        loggerContext.updateLoggers();

Review Comment:
   I must admit to disliking tests that read log messages. Can't we pass the 
info via the call stack?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to