OfframpWebSocketHandler extends AbstractWebSocketHandler { @Override public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception { metrics.markTransportError(); log.error("Road: {}, stream: {}, sessionId: {} - Transport Error", roadName, streamName, sessionId, exception); }  @Override void afterConnectionEstablished(WebSocketSession session); @Override void afterConnectionClosed(WebSocketSession session, CloseStatus status); @Override void handleTransportError(WebSocketSession session, Throwable exception);  }
@Test public void handleTransportError() throws Exception { underTest.afterConnectionEstablished(session); underTest.handleTransportError(session, new IOException()); verify(metrics).markTransportError(); }