Skip to content

Commit 2c175df

Browse files
authored
Merge pull request #2393 from pieninck/fixTypoInAetherFactories
fix: Correct class name of HttpTransporterFactory
2 parents e539343 + e83d065 commit 2c175df

2 files changed

Lines changed: 39 additions & 6 deletions

File tree

spring-cloud-contract-stub-runner/src/main/java/org/springframework/cloud/contract/stubrunner/AetherFactories.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
*/
6060
final class AetherFactories {
6161

62+
static final String BASIC_REPOSITORY_CONNECTOR_FACTORY_FQN = "org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory";
63+
64+
static final String FILE_TRANSPORTER_FACTORY_FQN = "org.eclipse.aether.transport.file.FileTransporterFactory";
65+
66+
static final String HTTP_TRANSPORTER_FACTORY_FQN = "org.eclipse.aether.transport.http.HttpTransporterFactory";
67+
6268
private static final Log log = LogFactory.getLog(AetherFactories.class);
6369

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

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

140-
registerIfPresent(locator, "org.eclipse.aether.transport.file.FileTransporterFactory",
141-
TransporterFactory.class);
145+
registerIfPresent(locator, FILE_TRANSPORTER_FACTORY_FQN, TransporterFactory.class);
142146

143-
registerIfPresent(locator, "org.eclipse.aether.transport.http.HttpTransporterFanewRepositorySystemctory",
144-
TransporterFactory.class);
147+
registerIfPresent(locator, HTTP_TRANSPORTER_FACTORY_FQN, TransporterFactory.class);
145148

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.springframework.cloud.contract.stubrunner;
2+
3+
import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory;
4+
import org.eclipse.aether.transport.file.FileTransporterFactory;
5+
import org.eclipse.aether.transport.http.HttpTransporterFactory;
6+
import org.junit.Test;
7+
8+
import static org.assertj.core.api.BDDAssertions.then;
9+
10+
/**
11+
* @author Jan-Niklas Pieninck
12+
*/
13+
public class AetherFactoriesTests {
14+
15+
@Test
16+
public void should_match_fqn_of_basic_repository_connector_factory() {
17+
then(AetherFactories.BASIC_REPOSITORY_CONNECTOR_FACTORY_FQN).isEqualTo(BasicRepositoryConnectorFactory.class.getName());
18+
}
19+
20+
@Test
21+
public void should_match_fqn_of_file_transporter_factory() {
22+
then(AetherFactories.FILE_TRANSPORTER_FACTORY_FQN).isEqualTo(FileTransporterFactory.class.getName());
23+
}
24+
25+
@Test
26+
public void should_match_fqn_of_http_transporter_factory() {
27+
then(AetherFactories.HTTP_TRANSPORTER_FACTORY_FQN).isEqualTo(HttpTransporterFactory.class.getName());
28+
}
29+
30+
}

0 commit comments

Comments
 (0)