slawekjaranowski commented on code in PR #13399:
URL: https://github.com/apache/maven/pull/13399#discussion_r4237095171
##########
apache-maven/src/test/java/org/apache/maven/settings/GlobalSettingsTest.java:
##########
@@ -48,4 +51,28 @@ void testValidGlobalSettings() throws Exception {
new SettingsXpp3Reader().read(reader);
}
}
+
+ @Test
+ void testGlobalSettingsInterpolation() throws Exception {
+ assertGlobalSettingsBuild("/home/user");
+ }
+
+ @Test
+ void testGlobalSettingsInterpolationWithDoubleHyphen() throws Exception {
+ assertGlobalSettingsBuild("/foo--bar/");
+ }
+
+ private void assertGlobalSettingsBuild(String userHome) throws Exception {
+ String basedir = System.getProperty("basedir",
System.getProperty("user.dir"));
+
+ Properties systemProperties = new Properties();
+ systemProperties.setProperty("user.home", userHome);
+ systemProperties.setProperty("maven.conf", new File(basedir,
"src/conf").getAbsolutePath());
+
+ DefaultSettingsBuildingRequest request = new
DefaultSettingsBuildingRequest();
+ request.setGlobalSettingsFile(new File(basedir,
"src/conf/settings.xml"));
+ request.setSystemProperties(systemProperties);
+
+ new DefaultSettingsBuilderFactory().newInstance().build(request);
Review Comment:
bot not have always right ... now we have test wit any assertions
so to be clear we can use `assertDoesNotThrow` here
--
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]