@Test
void toServerMessage() {

    var message = new TestWebSocketMessage();
    message.message = "value";
    assertThat(handler.toServerMessage(message)).isEqualTo("{\"message\":\"value\"}");
    assertThatThrownBy(() -> handler.toServerMessage(new MismatchTestMessage()))
            .isInstanceOf(Error.class)
            .hasMessageContaining("message class does not match");
}