File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
src/test/java/io/github/laeubi/httpclient Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 44import static org .junit .jupiter .api .Assertions .assertNotNull ;
55import static org .junit .jupiter .api .Assertions .assertTrue ;
66
7+ import java .lang .Runtime .Version ;
78import java .net .http .HttpClient ;
89import java .net .http .HttpRequest ;
910import java .net .http .HttpResponse ;
1011import java .util .ArrayList ;
1112import java .util .List ;
1213import java .util .concurrent .CompletableFuture ;
13- import java .util .concurrent .ExecutionException ;
1414
1515import org .junit .jupiter .api .AfterAll ;
1616import org .junit .jupiter .api .BeforeAll ;
@@ -26,6 +26,22 @@ public class JavaHttpClientConnectionReuseTest extends JavaHttpClientBase {
2626 @ BeforeAll
2727 public static void startServers () throws Exception {
2828 startHttpsServerNoGoaway ();
29+ assertTrue (isGoodJavaVersion (), Runtime .version () + " is known to contain the bug" );
30+ }
31+
32+ private static boolean isGoodJavaVersion () {
33+ Version version = Runtime .version ();
34+ int feature = version .feature ();
35+ if (feature >= 25 ) {
36+ return true ;
37+ }
38+ if (feature == 17 && version .compareTo (Version .parse ("17.0.17" )) >= 0 ) {
39+ return true ;
40+ }
41+ if (feature == 21 && version .compareTo (Version .parse ("21.0.8" )) >= 0 ) {
42+ return true ;
43+ }
44+ return false ;
2945 }
3046
3147 @ AfterAll
You can’t perform that action at this time.
0 commit comments