gnodet-bot commented on code in PR #14167:
URL: https://github.com/apache/maven/pull/14167#discussion_r4730431355
##########
impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/PluginUpgradeStrategyTest.java:
##########
@@ -575,6 +579,21 @@ void shouldNotUpgradeBndMavenPluginWhenSufficient() throws
Exception {
assertEquals("7.0.0", version, "bnd-maven-plugin 7.0.0 should not
be downgraded");
}
+ @Test
+ void shouldUpgradeBundlePluginFromPropertyWhenBndlib2x() throws
Exception {
+ Document doc = PomBuilder.create()
+ .property("bundle.plugin.version", "2.3.7")
+ .plugin("org.apache.felix", "maven-bundle-plugin",
"${bundle.plugin.version}")
+ .buildDocument();
+ strategy.doApply(createMockContext(), Map.of(Paths.get("pom.xml"),
doc));
+ String propertyValue = new Editor(doc)
+ .root()
+ .path("properties", "bundle.plugin.version")
+ .map(Element::textContentTrimmed)
+ .orElse(null);
+ assertEquals("5.1.1", propertyValue, "Property holding
bundle-plugin 2.3.7 should be upgraded to 5.1.1");
Review Comment:
🔹 **Low: `shouldUpgradeBundlePluginFromProperty` doesn't verify the warning
is emitted**
The sibling test `shouldUpgradeBundlePluginWhenBelowMinimum` was updated to
verify the bndlib warning, but this property-based test only checks the
upgraded version value. A 2.3.7→5.1.1 jump is exactly the scenario the warning
targets — it should be verified here too.
```suggestion
assertEquals("5.1.1", propertyValue, "Property holding
bundle-plugin 2.3.7 should be upgraded to 5.1.1");
verify(context.logger, atLeastOnce())
.warn(argThat((String msg) ->
msg.contains("maven-bundle-plugin") &&
msg.contains("bndlib") && msg.contains("OSGi")));
```
--
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]