@Test public void isOpenShouldReturnWebSocketStatus() { WebSocket mockWebSocket = getMockWebSocket(); WebSocketWrapper wrapper = new WebSocketWrapper(CHARGING_STATION_ID, mockWebSocket, mock(WampMessageHandler.class), gson); when(mockWebSocket.isOpen()).thenReturn(false); assertFalse(wrapper.isOpen()); when(mockWebSocket.isOpen()).thenReturn(true); assertTrue(wrapper.isOpen()); wrapper = new WebSocketWrapper(CHARGING_STATION_ID, null, mock(WampMessageHandler.class), gson); assertFalse(wrapper.isOpen()); }
public boolean isOpen() { return webSocket != null && webSocket.isOpen(); }
WebSocketWrapper { public boolean isOpen() { return webSocket != null && webSocket.isOpen(); } }
WebSocketWrapper { public boolean isOpen() { return webSocket != null && webSocket.isOpen(); } WebSocketWrapper(ChargingStationId chargingStationId, WebSocket webSocket, WampMessageHandler wampMessageHandler,
                            Gson gson); }
WebSocketWrapper { public boolean isOpen() { return webSocket != null && webSocket.isOpen(); } WebSocketWrapper(ChargingStationId chargingStationId, WebSocket webSocket, WampMessageHandler wampMessageHandler,
                            Gson gson); WebSocket getWebSocket(); boolean isOpen(); void close(); void sendMessage(WampMessage wampMessage); void sendResultMessage(WampMessage wampMessage); }
WebSocketWrapper { public boolean isOpen() { return webSocket != null && webSocket.isOpen(); } WebSocketWrapper(ChargingStationId chargingStationId, WebSocket webSocket, WampMessageHandler wampMessageHandler,
                            Gson gson); WebSocket getWebSocket(); boolean isOpen(); void close(); void sendMessage(WampMessage wampMessage); void sendResultMessage(WampMessage wampMessage);  }