elharo commented on code in PR #306:
URL: 
https://github.com/apache/maven-remote-resources-plugin/pull/306#discussion_r4229632187


##########
src/test/java/org/apache/maven/plugin/resources/remote/RemoteResourcesMojoTest.java:
##########
@@ -254,6 +254,33 @@ public void testFilteredBundles() throws Exception {
         assertTrue(data.contains("projectsSortedByOrganization: {"));
     }
 
+    public void testFilteredAppendedResource() throws Exception {
+        final MavenProjectResourcesStub project = 
createTestProject("default-appended-filtered-resource");
+        final ProcessRemoteResourcesMojo mojo =
+                lookupProcessMojoWithSettings(project, new String[] 
{"test:test:1.1"});
+
+        setupDefaultProject(project);
+
+        String path = pathOf(new DefaultArtifact(
+                "test", "test", VersionRange.createFromVersion("1.1"), null, 
"jar", "", new DefaultArtifactHandler()));
+        File file = new File(path);
+        file.getParentFile().mkdirs();
+        buildResourceBundle("default-appended-filtered-resource-create", null, 
new String[] {"FILTER.txt.vm"}, file);
+
+        File appendedResourcesDirectory = new File(project.getBasedir(), 
"src/main/appended-resources");
+        appendedResourcesDirectory.mkdirs();
+        FileUtils.fileWrite(
+                new File(appendedResourcesDirectory, 
"FILTER.txt.vm").getAbsolutePath(),
+                "appended: $project.name");
+        setVariableValueToObject(mojo, "appendedResourcesDirectory", 
appendedResourcesDirectory);
+
+        mojo.execute();
+
+        file = (File) getVariableValueFromObject(mojo, "outputDirectory");

Review Comment:
   don't reuse local variables for different things



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