@Test
void closeCode() {

    assertThat(listener.closeCode(new Error()))
            .isEqualTo(WebSocketCloseCodes.INTERNAL_ERROR);
    assertThat(listener.closeCode(new TooManyRequestsException("rate exceeds")))
            .isEqualTo(WebSocketCloseCodes.TRY_AGAIN_LATER);
    assertThat(listener.closeCode(new BadRequestException("bad request")))
            .isEqualTo(WebSocketCloseCodes.POLICY_VIOLATION);
}