Skip to content

Commit 37c3ac1

Browse files
committed
[BAEL-13602] - Updated HttpClient Basic Authentication article
1 parent 4fd430d commit 37c3ac1

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

httpclient-simple/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
88
### Relevant Articles:
99

1010
- [HttpClient 4 – Get the Status Code](http://www.baeldung.com/httpclient-status-code)
11-
- [HttpClient with SSL](http://www.baeldung.com/httpclient-ssl)
11+
- [HttpClient with SSL](http://www.baeldung.com/httpclient-ssl)
12+
- [HttpClient Basic Authentication](http://www.baeldung.com/httpclient-4-basic-authentication)

httpclient/src/test/java/org/baeldung/httpclient/sec/HttpClientAuthLiveTest.java renamed to httpclient-simple/src/test/java/org/baeldung/httpclient/sec/HttpClientAuthLiveTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@
2323
import org.junit.Test;
2424

2525
import java.io.IOException;
26-
import java.nio.charset.Charset;
2726
import java.nio.charset.StandardCharsets;
2827

2928
import static org.hamcrest.Matchers.equalTo;
3029
import static org.junit.Assert.assertThat;
3130

3231
/*
33-
* NOTE : Need module spring-security-rest-basic-auth to be running
32+
* NOTE : Need module httpclient-simple to be running
3433
*/
3534

3635
public class HttpClientAuthLiveTest {
3736

38-
private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://localhost:8081/spring-security-rest-basic-auth/api/foos/1";
37+
private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://localhost:8082/httpclient-simple/api/foos/1";
3938
private static final String DEFAULT_USER = "user1";
4039
private static final String DEFAULT_PASS = "user1Pass";
4140

@@ -111,7 +110,7 @@ private CredentialsProvider provider() {
111110
}
112111

113112
private HttpContext context() {
114-
final HttpHost targetHost = new HttpHost("localhost", 8080, "http");
113+
final HttpHost targetHost = new HttpHost("localhost", 8082, "http");
115114
final CredentialsProvider credsProvider = new BasicCredentialsProvider();
116115
credsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(DEFAULT_USER, DEFAULT_PASS));
117116

httpclient/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
1313
- [Unshorten URLs with HttpClient](http://www.baeldung.com/unshorten-url-httpclient)
1414
- [HttpClient 4 – Follow Redirects for POST](http://www.baeldung.com/httpclient-redirect-on-http-post)
1515
- [Custom HTTP Header with the HttpClient](http://www.baeldung.com/httpclient-custom-http-header)
16-
- [HttpClient Basic Authentication](http://www.baeldung.com/httpclient-4-basic-authentication)
1716
- [Multipart Upload with HttpClient 4](http://www.baeldung.com/httpclient-multipart-upload)
1817
- [HttpAsyncClient Tutorial](http://www.baeldung.com/httpasyncclient-tutorial)
1918
- [HttpClient 4 Tutorial](http://www.baeldung.com/httpclient-guide)

0 commit comments

Comments
 (0)