Skip to content

Commit e72343a

Browse files
committed
separate host and port
1 parent 738be52 commit e72343a

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

src/test/java/software/amazon/awssdk/crt/test/WriteDataTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,22 @@
1818
import java.util.concurrent.TimeUnit;
1919

2020
public class WriteDataTest extends HttpRequestResponseFixture {
21-
private final static String H2_HOST = "https://localhost:3443";
22-
private final static String H1_HOST = "https://localhost:8082";
21+
private final static String HOST = "https://localhost";
22+
private final static int H1_TLS_PORT = 8082;
23+
private final static int H2_TLS_PORT = 3443;
2324

2425
@Test
2526
public void testHttp2WriteData() throws Exception {
2627
skipIfAndroid();
2728
skipIfLocalhostUnavailable();
2829

29-
URI uri = new URI(H2_HOST);
30+
URI uri = new URI(HOST + ":" + H2_TLS_PORT);
3031
byte[] payload = "hello from writeData".getBytes(StandardCharsets.UTF_8);
3132

3233
HttpHeader[] headers = new HttpHeader[]{
3334
new HttpHeader(":method", "PUT"),
3435
new HttpHeader(":path", "/echo"),
35-
new HttpHeader(":scheme", uri.getScheme()),
36+
new HttpHeader(":scheme", "https"),
3637
new HttpHeader(":authority", uri.getHost()),
3738
new HttpHeader("content-length", Integer.toString(payload.length)),
3839
};
@@ -94,12 +95,12 @@ public void testHttp2WriteDataEndStreamOnly() throws Exception {
9495
skipIfAndroid();
9596
skipIfLocalhostUnavailable();
9697

97-
URI uri = new URI(H2_HOST);
98+
URI uri = new URI(HOST + ":" + H2_TLS_PORT);
9899

99100
HttpHeader[] headers = new HttpHeader[]{
100101
new HttpHeader(":method", "GET"),
101102
new HttpHeader(":path", "/echo"),
102-
new HttpHeader(":scheme", uri.getScheme()),
103+
new HttpHeader(":scheme", "https"),
103104
new HttpHeader(":authority", uri.getHost()),
104105
};
105106
Http2Request request = new Http2Request(headers, null);
@@ -159,7 +160,7 @@ public void testHttp1WriteData() throws Exception {
159160
skipIfAndroid();
160161
skipIfLocalhostUnavailable();
161162

162-
URI uri = new URI(H1_HOST);
163+
URI uri = new URI(HOST + ":" + H1_TLS_PORT);
163164
byte[] payload = "hello from writeData h1".getBytes(StandardCharsets.UTF_8);
164165

165166
HttpHeader[] headers = new HttpHeader[]{
@@ -222,7 +223,7 @@ public void testHttp1WriteDataEndStreamOnly() throws Exception {
222223
skipIfAndroid();
223224
skipIfLocalhostUnavailable();
224225

225-
URI uri = new URI(H1_HOST);
226+
URI uri = new URI(HOST + ":" + H1_TLS_PORT);
226227

227228
HttpHeader[] headers = new HttpHeader[]{
228229
new HttpHeader("Host", uri.getHost()),

0 commit comments

Comments
 (0)