elharo commented on code in PR #843:
URL: 
https://github.com/apache/maven-shade-plugin/pull/843#discussion_r3880682494


##########
src/test/java/org/apache/maven/plugins/shade/pom/PomWriterRelativePathTest.java:
##########
@@ -0,0 +1,72 @@
+/*
+ * 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.plugins.shade.pom;
+
+import java.io.StringWriter;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Parent;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class PomWriterRelativePathTest {
+    @Test
+    public void emptyRelativePathIsWritten() throws Exception {
+        Model model = new Model();
+        model.setModelVersion("4.0.0");
+        model.setGroupId("g");
+        model.setArtifactId("a");
+        model.setVersion("1.0");
+        Parent parent = new Parent();
+        parent.setGroupId("pg");
+        parent.setArtifactId("pa");
+        parent.setVersion("1.0");
+        parent.setRelativePath("");
+        model.setParent(parent);
+
+        StringWriter writer = new StringWriter();
+        PomWriter.write(writer, model, true);
+        String xml = writer.toString();
+
+        assertTrue(xml.contains("<relativePath"), xml);

Review Comment:
   could you expand this test to cover not just the tag but the complete 
element that shows the path? 



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