use of org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory in project spring-boot by spring-projects.
the class SettingsXmlRepositorySystemSessionAutoConfigurationTests method propertyInterpolation.
@Test
public void propertyInterpolation() throws SettingsBuildingException {
final DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession();
given(this.repositorySystem.newLocalRepositoryManager(eq(session), any(LocalRepository.class))).willAnswer(new Answer<LocalRepositoryManager>() {
@Override
public LocalRepositoryManager answer(InvocationOnMock invocation) throws Throwable {
LocalRepository localRepository = invocation.getArgument(1);
return new SimpleLocalRepositoryManagerFactory().newInstance(session, localRepository);
}
});
SystemProperties.doWithSystemProperties(new Runnable() {
@Override
public void run() {
new SettingsXmlRepositorySystemSessionAutoConfiguration().apply(session, SettingsXmlRepositorySystemSessionAutoConfigurationTests.this.repositorySystem);
}
}, "user.home:src/test/resources/maven-settings/property-interpolation", "foo:bar");
assertThat(session.getLocalRepository().getBasedir().getAbsolutePath()).endsWith(File.separatorChar + "bar" + File.separatorChar + "repository");
}
Aggregations