|
1 | 1 | package org.jooby.issues; |
2 | 2 |
|
3 | | -import static org.junit.Assert.assertEquals; |
4 | | -import static org.junit.Assert.assertNotNull; |
5 | | -import static org.junit.Assert.assertTrue; |
6 | | - |
7 | | -import java.io.IOException; |
8 | | -import java.io.InputStream; |
9 | | -import java.io.OutputStream; |
10 | | -import java.net.InetSocketAddress; |
11 | | -import java.net.Socket; |
12 | | -import java.net.SocketTimeoutException; |
13 | | -import java.nio.ByteBuffer; |
14 | | -import java.nio.charset.StandardCharsets; |
15 | | -import java.util.HashMap; |
16 | | -import java.util.Map; |
17 | | -import java.util.concurrent.CountDownLatch; |
18 | | -import java.util.concurrent.Phaser; |
19 | | -import java.util.concurrent.TimeUnit; |
20 | | -import java.util.concurrent.atomic.AtomicReference; |
21 | | - |
| 3 | +import com.google.common.collect.ImmutableMap; |
22 | 4 | import org.eclipse.jetty.http.HttpFields; |
23 | 5 | import org.eclipse.jetty.http.HttpURI; |
24 | 6 | import org.eclipse.jetty.http.HttpVersion; |
|
46 | 28 | import org.jooby.test.ServerFeature; |
47 | 29 | import org.junit.Test; |
48 | 30 |
|
49 | | -import com.google.common.collect.ImmutableMap; |
| 31 | +import java.io.IOException; |
| 32 | +import java.io.InputStream; |
| 33 | +import java.io.OutputStream; |
| 34 | +import java.net.InetSocketAddress; |
| 35 | +import java.net.Socket; |
| 36 | +import java.net.SocketTimeoutException; |
| 37 | +import java.nio.ByteBuffer; |
| 38 | +import java.nio.charset.StandardCharsets; |
| 39 | +import java.util.HashMap; |
| 40 | +import java.util.Map; |
| 41 | +import java.util.concurrent.CountDownLatch; |
| 42 | +import java.util.concurrent.Phaser; |
| 43 | +import java.util.concurrent.TimeUnit; |
| 44 | +import java.util.concurrent.atomic.AtomicReference; |
| 45 | + |
| 46 | +import static org.junit.Assert.assertEquals; |
| 47 | +import static org.junit.Assert.assertNotNull; |
| 48 | +import static org.junit.Assert.assertTrue; |
50 | 49 |
|
51 | 50 | public class Issue418 extends ServerFeature { |
52 | 51 |
|
@@ -139,7 +138,7 @@ public void h2cpush() throws Throwable { |
139 | 138 | Map<String, Object> pushPromise = (Map<String, Object>) stream2.get("push-promise"); |
140 | 139 | assertEquals(1, pushPromise.get("streamId")); |
141 | 140 | assertEquals(2, pushPromise.get("promisedStreamId")); |
142 | | - assertEquals("http://localhost:9999/app.js", pushPromise.get("uri")); |
| 141 | + assertEquals("http://localhost:" + port + "/app.js", pushPromise.get("uri")); |
143 | 142 | assertEquals("GET", pushPromise.get("method")); |
144 | 143 | } |
145 | 144 |
|
@@ -191,7 +190,7 @@ public void h2cpushWithHeader() throws Throwable { |
191 | 190 | assertEquals(1, pushPromise.get("streamId")); |
192 | 191 | assertEquals(2, pushPromise.get("promisedStreamId")); |
193 | 192 | assertEquals("123", pushPromise.get("etag")); |
194 | | - assertEquals("http://localhost:9999/app.js", pushPromise.get("uri")); |
| 193 | + assertEquals("http://localhost:" + port + "/app.js", pushPromise.get("uri")); |
195 | 194 | assertEquals("GET", pushPromise.get("method")); |
196 | 195 | } |
197 | 196 |
|
|
0 commit comments