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


##########
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:
   That is fair.  I switched to a Mockito spy approach that verifies 
"registerShapeId" never gets called in this test case.  I also removed the 
log4j requires from module-info.java as it's no longer needed.



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