-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4126b80
commit c9a6b0f
Showing
4 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ public void testHttpDebug() { | |
|
||
@Test | ||
public void testDebugHttpRequest() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
Mockito.when(request.getSysMethod()).thenReturn(MethodType.GET); | ||
Mockito.when(request.getSysUrl()).thenReturn("http://test.domain"); | ||
Map<String, String> requestHeaders = new HashMap<String, String>(); | ||
|
@@ -110,7 +110,7 @@ public void testDebugHttpResponse() throws ClientException { | |
|
||
@Test | ||
public void testDebugHttpRquestException() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
Mockito.when(request.getSysMethod()).thenReturn(MethodType.GET); | ||
Mockito.when(request.getSysUrl()).thenReturn("httpss://test.domain/jdj"); | ||
Map<String, String> requestHeaders = new HashMap<String, String>(); | ||
|
@@ -163,44 +163,44 @@ public void testDebugHttpResponseException() throws ClientException { | |
|
||
@Test | ||
public void testGetJDKProxyException() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
thrown.expect(ClientException.class); | ||
Proxy proxy = HttpUtil.getJDKProxy("http0://www.aliyun.com", null, request); | ||
Assert.assertNotNull(proxy); | ||
} | ||
|
||
@Test | ||
public void testGetJDKProxyEnvProxyHasUserInfo() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
Proxy proxy = HttpUtil.getJDKProxy(null, "http://user:[email protected]", request); | ||
Assert.assertNotNull(proxy); | ||
} | ||
|
||
@Test | ||
public void testGetJDKProxyEnvProxyNoUserInfo() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
Proxy proxy = HttpUtil.getJDKProxy(null, "http://www.aliyun.com:80", request); | ||
Assert.assertNotNull(proxy); | ||
} | ||
|
||
@Test | ||
public void testGetApacheProxyException() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
thrown.expect(ClientException.class); | ||
HttpHost proxy = HttpUtil.getApacheProxy("http0://www.aliyun.com", null, request); | ||
Assert.assertNotNull(proxy); | ||
} | ||
|
||
@Test | ||
public void testGetApacheProxyEnvProxyHasUserInfo() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
HttpHost proxy = HttpUtil.getApacheProxy(null, "http://user:[email protected]", request); | ||
Assert.assertNotNull(proxy); | ||
} | ||
|
||
@Test | ||
public void testGetApacheProxyEnvProxyNoUserInfo() throws ClientException { | ||
HttpRequest request = mock(HttpRequest.class); | ||
HttpRequest request = new HttpRequest("mock url"); | ||
HttpHost proxy = HttpUtil.getApacheProxy(null, "http://www.aliyun.com:80", request); | ||
Assert.assertNotNull(proxy); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters