final String channelId = UUID.randomUUID().toString();
final String register = JsonUtil.toJson(new RegisterMessageImpl(channelId));
final ChannelFuture registerFuture = ch.writeAndFlush(new TextWebSocketFrame(register));
registerFuture.sync();
final TextWebSocketFrame registerFrame = handler.getTextFrame();
final RegisterResponseImpl registerResponse = JsonUtil.fromJson(registerFrame.text(), RegisterResponseImpl.class);
assertThat(registerResponse.getMessageType(), equalTo(MessageType.Type.REGISTER));
assertThat(registerResponse.getChannelId(), equalTo(channelId));
ch.writeAndFlush(new CloseWebSocketFrame());