public class PlainTextMessageCodecTest {
private void check(Message message, String expected) {
PlainTextMessageCodec codec = new PlainTextMessageCodec();
ChannelBuffer buf = ChannelBuffers.dynamicBuffer();
Context ctx = new Context().setBuffer(buf);
codec.setBufferWriter(new EscapingBufferWriter());
codec.encodeMessage(message, buf);
String actual = buf.toString(Charset.forName("utf-8"));