Fix logic when placeholder is at the end of the URL. (#1429)

This commit is contained in:
Ryan Baxter
2019-07-18 12:04:16 -04:00
committed by GitHub
parent dfa31c918a
commit b33ddb9bce
2 changed files with 23 additions and 1 deletions

View File

@@ -104,6 +104,23 @@ public class HttpClientConfigurableHttpConnectionFactoryTest {
assertThat(actualHttpClientBuilder).isSameAs(expectedHttpClientBuilder);
}
@Test
public void urlWithPlaceholdersAtEnd() throws Exception {
MultipleJGitEnvironmentProperties properties = new MultipleJGitEnvironmentProperties();
properties.setUri("https://localhost/v1/repos/pvvts_configs-{application}");
this.connectionFactory.addConfiguration(properties);
HttpConnection actualConnection = this.connectionFactory.create(
new URL("https://localhost/v1/repos/pvvts_configs-applicationPasswords"
+ "/some/path.properties"));
HttpClientBuilder expectedHttpClientBuilder = this.connectionFactory.httpClientBuildersByUri
.values().stream().findFirst().get();
HttpClientBuilder actualHttpClientBuilder = getActualHttpClientBuilder(
actualConnection);
assertThat(actualHttpClientBuilder).isSameAs(expectedHttpClientBuilder);
}
@Test
public void composite_sameHost() throws Exception {
MultipleJGitEnvironmentProperties properties1 = new MultipleJGitEnvironmentProperties();