use of org.mule.maven.client.api.model.RemoteRepository in project mule by mulesoft.
the class MavenConfigTestCase method loadSettings.
@Description("Loads the global and user settings from system properties")
@Test
public void loadSettings() throws Exception {
File userSettings = temporaryFolder.newFile();
File globalSettings = temporaryFolder.newFile();
Map<String, String> properties = new HashMap<>();
properties.put("muleRuntimeConfig.maven.userSettingsLocation", userSettings.getAbsolutePath());
properties.put("muleRuntimeConfig.maven.globalSettingsLocation", globalSettings.getAbsolutePath());
testWithSystemProperties(properties, () -> {
GlobalConfigLoader.reset();
MavenConfiguration mavenConfig = getMavenConfig();
List<RemoteRepository> mavenRemoteRepositories = mavenConfig.getMavenRemoteRepositories();
assertThat(mavenRemoteRepositories, hasSize(1));
assertThat(mavenRemoteRepositories.get(0).getId(), is("mavenCentral"));
assertThat(mavenConfig.getGlobalSettingsLocation().isPresent(), is(true));
assertThat(mavenConfig.getGlobalSettingsLocation().get(), is(globalSettings));
assertThat(mavenConfig.getUserSettingsLocation().isPresent(), is(true));
assertThat(mavenConfig.getUserSettingsLocation().get(), is(userSettings));
});
}
Aggregations