elharo commented on code in PR #78:
URL: https://github.com/apache/maven-filtering/pull/78#discussion_r1367913545


##########
src/test/java/org/apache/maven/shared/filtering/PropertyUtilsTest.java:
##########
@@ -143,32 +140,59 @@ public void testCircularReferences3Vars() throws 
IOException {
         }
 
         basicProp.createNewFile();
-        try (FileWriter writer = new FileWriter(basicProp)) {
+        try (Writer writer = new OutputStreamWriter(new 
FileOutputStream(basicProp), StandardCharsets.UTF_8)) {
             writer.write("test=${test2}\n");
             writer.write("test2=${test3}\n");
             writer.write("test3=${test}\n");
             writer.flush();
         }
 
         Logger logger = mock(Logger.class);
-
         Properties prop = PropertyUtils.loadPropertyFile(basicProp, null, 
logger);
         assertEquals("${test2}", prop.getProperty("test"));
         assertEquals("${test3}", prop.getProperty("test2"));
         assertEquals("${test}", prop.getProperty("test3"));
-        assertWarn(
-                logger,
-                "Circular reference between properties detected: test3 => test 
=> test2 => test3",
-                "Circular reference between properties detected: test2 => 
test3 => test => test2",
-                "Circular reference between properties detected: test => test2 
=> test3 => test");
     }
 
-    private void assertWarn(Logger mock, String... expected) {
-        ArgumentCaptor<String> argument = 
ArgumentCaptor.forClass(String.class);
-        verify(mock, times(expected.length)).warn(argument.capture());
-        List<String> messages = argument.getAllValues();
-        for (String str : expected) {
-            assertTrue(messages.contains(str));
+    public void testNonCircularReferences1Var3Times() throws IOException {
+        File basicProp = new File(testDirectory, "non-circular.properties");

Review Comment:
   use File.createTempFile and delete it in a finally block



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to