Skip to content

Commit a832944

Browse files
committed
Rename HtppClientOption to HttpClientOption
Fixes gh-1874
1 parent eecdb92 commit a832944

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

spring-boot/src/main/java/org/springframework/boot/test/TestRestTemplate.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class TestRestTemplate extends RestTemplate {
5555
* Create a new {@link TestRestTemplate} instance.
5656
* @param httpClientOptions client options to use if the Apache HTTP Client is used
5757
*/
58-
public TestRestTemplate(HtppClientOption... httpClientOptions) {
58+
public TestRestTemplate(HttpClientOption... httpClientOptions) {
5959
this(null, null, httpClientOptions);
6060
}
6161

@@ -66,7 +66,7 @@ public TestRestTemplate(HtppClientOption... httpClientOptions) {
6666
* @param httpClientOptions client options to use if the Apache HTTP Client is used
6767
*/
6868
public TestRestTemplate(String username, String password,
69-
HtppClientOption... httpClientOptions) {
69+
HttpClientOption... httpClientOptions) {
7070
if (ClassUtils.isPresent("org.apache.http.client.config.RequestConfig", null)) {
7171
setRequestFactory(new CustomHttpComponentsClientHttpRequestFactory(
7272
httpClientOptions));
@@ -94,7 +94,7 @@ private void addAuthentication(String username, String password) {
9494
/**
9595
* Options used to customize the Apache Http Client if it is used.
9696
*/
97-
public static enum HtppClientOption {
97+
public static enum HttpClientOption {
9898

9999
/**
100100
* Enable cookies.
@@ -139,12 +139,12 @@ protected static class CustomHttpComponentsClientHttpRequestFactory extends
139139
private final boolean enableRedirects;
140140

141141
public CustomHttpComponentsClientHttpRequestFactory(
142-
HtppClientOption[] httpClientOptions) {
143-
Set<HtppClientOption> options = new HashSet<TestRestTemplate.HtppClientOption>(
142+
HttpClientOption[] httpClientOptions) {
143+
Set<HttpClientOption> options = new HashSet<TestRestTemplate.HttpClientOption>(
144144
Arrays.asList(httpClientOptions));
145-
this.cookieSpec = (options.contains(HtppClientOption.ENABLE_COOKIES) ? CookieSpecs.STANDARD
145+
this.cookieSpec = (options.contains(HttpClientOption.ENABLE_COOKIES) ? CookieSpecs.STANDARD
146146
: CookieSpecs.IGNORE_COOKIES);
147-
this.enableRedirects = options.contains(HtppClientOption.ENABLE_REDIRECTS);
147+
this.enableRedirects = options.contains(HttpClientOption.ENABLE_REDIRECTS);
148148
}
149149

150150
@Override
@@ -162,4 +162,5 @@ protected RequestConfig getRequestConfig() {
162162
}
163163

164164
}
165+
165166
}

spring-boot/src/test/java/org/springframework/boot/test/TestRestTemplateTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import org.apache.http.client.config.RequestConfig;
2020
import org.junit.Test;
2121
import org.springframework.boot.test.TestRestTemplate.CustomHttpComponentsClientHttpRequestFactory;
22-
import org.springframework.boot.test.TestRestTemplate.HtppClientOption;
22+
import org.springframework.boot.test.TestRestTemplate.HttpClientOption;
2323
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
2424
import org.springframework.http.client.InterceptingClientHttpRequestFactory;
2525

@@ -49,10 +49,11 @@ public void authenticated() {
4949
@Test
5050
public void options() throws Exception {
5151
TestRestTemplate template = new TestRestTemplate(
52-
HtppClientOption.ENABLE_REDIRECTS);
52+
HttpClientOption.ENABLE_REDIRECTS);
5353
CustomHttpComponentsClientHttpRequestFactory factory = (CustomHttpComponentsClientHttpRequestFactory) template
5454
.getRequestFactory();
5555
RequestConfig config = factory.getRequestConfig();
5656
assertThat(config.isRedirectsEnabled(), equalTo(true));
5757
}
58+
5859
}

0 commit comments

Comments
 (0)