elharo commented on code in PR #11509:
URL: https://github.com/apache/maven/pull/11509#discussion_r2592513087


##########
impl/maven-xml/src/test/java/org/apache/maven/internal/xml/XmlNodeBuilderTest.java:
##########
@@ -44,6 +46,10 @@ public int read(char[] cbuf, int off, int len) throws 
IOException {
         XmlNode node1 = XmlService.read(r);
         XmlNode node2 = XmlService.read(r);
         assertEquals(node1, node2);
+
+        node1 = XmlService.read(new 
ByteArrayInputStream(doc.getBytes(StandardCharsets.UTF_8)), null);

Review Comment:
   don't reuse local variables. New variables or better yet a completely new 
test method. 



##########
impl/maven-core/src/test/java/org/apache/maven/plugin/CacheUtilsTest.java:
##########
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.plugin;
+
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Plugin;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+class CacheUtilsTest {
+
+    private Plugin pluginOne;
+    private Plugin pluginTwo;
+
+    @BeforeEach

Review Comment:
   could just initialize the fields



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

Reply via email to