Skip to content

Commit 8961fa8

Browse files
committed
Document why surefire config is left untouched with multiple argLine tags
1 parent c101d0d commit 8961fa8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/org/openrewrite/java/migrate/AddMockitoJavaAgentToMavenSurefirePlugin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) {
160160
return autoFormat(t.withContent(ListUtils.map(pluginContents, c -> c == config ? updatedConfig : c)), ctx);
161161
}
162162
}
163+
// Any remaining case needs no surefire change: either the single argLine already
164+
// contains the agent, or there are multiple <argLine> tags. Multiple tags are an
165+
// ambiguous configuration, since surefire's argLine is single-valued and only the
166+
// first tag is honored; appending another would be silently ignored, so we leave
167+
// the configuration untouched rather than guess which argLine to augment.
163168
return t;
164169
}
165170
});

0 commit comments

Comments
 (0)