Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
*/
final class AetherFactories {

static final String BASIC_REPOSITORY_CONNECTOR_FACTORY_FQN = "org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory";

static final String FILE_TRANSPORTER_FACTORY_FQN = "org.eclipse.aether.transport.file.FileTransporterFactory";

static final String HTTP_TRANSPORTER_FACTORY_FQN = "org.eclipse.aether.transport.http.HttpTransporterFactory";

private static final Log log = LogFactory.getLog(AetherFactories.class);

private static final String MAVEN_LOCAL_REPOSITORY_LOCATION = "maven.repo.local";
Expand Down Expand Up @@ -134,14 +140,11 @@ public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable except

// Try to register connector + transporters reflectively, but do not hard-link
// them.
registerIfPresent(locator, "org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory",
RepositoryConnectorFactory.class);
registerIfPresent(locator, BASIC_REPOSITORY_CONNECTOR_FACTORY_FQN, RepositoryConnectorFactory.class);

registerIfPresent(locator, "org.eclipse.aether.transport.file.FileTransporterFactory",
TransporterFactory.class);
registerIfPresent(locator, FILE_TRANSPORTER_FACTORY_FQN, TransporterFactory.class);

registerIfPresent(locator, "org.eclipse.aether.transport.http.HttpTransporterFanewRepositorySystemctory",
TransporterFactory.class);
registerIfPresent(locator, HTTP_TRANSPORTER_FACTORY_FQN, TransporterFactory.class);

RepositorySystem system = locator.getService(RepositorySystem.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.springframework.cloud.contract.stubrunner;

import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
import org.eclipse.aether.transport.file.FileTransporterFactory;
import org.eclipse.aether.transport.http.HttpTransporterFactory;
import org.junit.Test;

import static org.assertj.core.api.BDDAssertions.then;

/**
* @author Jan-Niklas Pieninck
*/
public class AetherFactoriesTests {

@Test
public void should_match_fqn_of_basic_repository_connector_factory() {
then(AetherFactories.BASIC_REPOSITORY_CONNECTOR_FACTORY_FQN).isEqualTo(BasicRepositoryConnectorFactory.class.getName());
}

@Test
public void should_match_fqn_of_file_transporter_factory() {
then(AetherFactories.FILE_TRANSPORTER_FACTORY_FQN).isEqualTo(FileTransporterFactory.class.getName());
}

@Test
public void should_match_fqn_of_http_transporter_factory() {
then(AetherFactories.HTTP_TRANSPORTER_FACTORY_FQN).isEqualTo(HttpTransporterFactory.class.getName());
}

}