@@ -0,0 +1,1369 @@
+package com.suse.saltstack.netapi.event;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.websocket.CloseReason;%0Aimport javax.websocket.OnClose;%0Aimport javax.websocket.OnMessage;%0Aimport javax.websocket.OnOpen;%0Aimport javax.websocket.Session;%0Aimport javax.websocket.server.ServerEndpoint;%0A%0Aimport com.suse.saltstack.netapi.utils.ClientUtils;%0A%0A/**%0A * This class is intended to emulate the Server WebSocket%0A * EndPoint where EventStream is connected to, and where events came from.%0A */%0A@ServerEndpoint(value = %22/token%22)%0Apublic class WebSocketServerSalt %7B%0A%0A    /**%0A     * Note: The event stream message is a String delimited by %22%5Cn%5Cn%22. The resource file%0A     * events_stream.txt contains some events separated by %22%5Cn%5Cn%22.%0A     */%0A    static final String%5B%5D TEXT_EVENT_STREAM_MESSAGES =%0A            ClientUtils.streamToString(WebSocketServerSalt.class%0A                    .getResourceAsStream(%22/events_stream.txt%22)).split(%22%5Cn%5Cn%22);%0A%0A    @OnOpen%0A    public void onOpen(Session session) %7B%0A    %7D%0A%0A    @OnMessage%0A    public void onMessage(String message, Session session) %7B%0A        try %7B%0A            for (String s : TEXT_EVENT_STREAM_MESSAGES) %7B%0A                session.getBasicRemote().sendText(s);%0A            %7D%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    @OnClose%0A    public void onClose(Session session, CloseReason closeReason) %7B%0A    %7D%0A%7D%0A

Add an emulation of a websocket server endpoint