@@ -0,0 +1,2305 @@
+/*%0A * Zed Attack Proxy (ZAP) and its related class files.%0A *%0A * ZAP is an HTTP/HTTPS proxy for assessing web application security.%0A *%0A * Copyright 2019 The ZAP Development Team%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.zaproxy.zap.extension.websocket;%0A%0Aimport java.io.IOException;%0Aimport org.parosproxy.paros.network.HttpMessage;%0Aimport org.zaproxy.zap.extension.websocket.client.HandshakeConfig;%0Aimport org.zaproxy.zap.extension.websocket.client.HttpHandshakeBuilder;%0Aimport org.zaproxy.zap.extension.websocket.client.ServerConnectionEstablisher;%0Aimport org.zaproxy.zap.testutils.WebSocketTestUtils;%0A%0Apublic abstract class WebSocketAddonTestUtils extends WebSocketTestUtils %7B%0A%0A    public WebSocketProxy setupWebSocketProxy() %7B%0A        ServerConnectionEstablisher establisher = new ServerConnectionEstablisher();%0A        try %7B%0A            HttpMessage handshakeRequest =%0A                    new HttpMessage(%0A                            HttpHandshakeBuilder.getHttpHandshakeRequestHeader(%0A                                    super.getServerUrl()));%0A            return establisher.send(new HandshakeConfig(handshakeRequest, false, false));%0A        %7D catch (Exception e) %7B%0A            return null;%0A        %7D%0A    %7D%0A%0A    public WebSocketMessageDTO sendOutgoingMessage(WebSocketProxy webSocketProxy, String message) %7B%0A        WebSocketMessageDTO webSocketMessage = new WebSocketMessageDTO(webSocketProxy.getDTO());%0A        webSocketMessage.payload = message;%0A        webSocketMessage.opcode = WebSocketMessage.OPCODE_TEXT;%0A%0A        try %7B%0A            return webSocketProxy.send(webSocketMessage, WebSocketProxy.Initiator.MANUAL_REQUEST)%0A                    ? webSocketMessage%0A                    : null;%0A        %7D catch (IOException e) %7B%0A            return null;%0A        %7D%0A    %7D%0A%7D%0A

Add Base Class for WebSocket Unit testing