test/jdk/java/net/httpclient/websocket/jdk.incubator.httpclient/jdk/incubator/http/internal/websocket/BuildingWebSocketTest.java
branchhttp-client-branch
changeset 55764 34d7cc00f87a
parent 47216 71c04702a3d5
child 55824 b922df193260
equal deleted inserted replaced
55763:634d8e14c172 55764:34d7cc00f87a
     1 /*
     1 /*
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    87                             .connectTimeout(null));
    87                             .connectTimeout(null));
    88     }
    88     }
    89 
    89 
    90     @Test(dataProvider = "badURIs")
    90     @Test(dataProvider = "badURIs")
    91     void illegalURI(String u) {
    91     void illegalURI(String u) {
    92         WebSocket.Builder b = HttpClient.newHttpClient()
    92         assertThrows(IllegalArgumentException.class,
    93                 .newWebSocketBuilder(URI.create(u), listener());
    93                 () -> HttpClient.newHttpClient()
    94         assertCompletesExceptionally(IllegalArgumentException.class, b.buildAsync());
    94                                 .newWebSocketBuilder(URI.create(u), listener()));
    95     }
    95     }
    96 
    96 
    97     @Test
    97     @Test
    98     public void illegalHeaders() {
    98     public void illegalHeaders() {
    99         List<String> headers = List.of("Authorization",
    99         List<String> headers = List.of("Authorization",