@Test
public void testSpdySynStreamFrame() throws Exception {

    short type = 1;
    byte flags = 0;
    int length = 10;
    int streamId = RANDOM.nextInt() & 0x7FFFFFFF | 0x01;
    int associatedToStreamId = RANDOM.nextInt() & 0x7FFFFFFF;
    byte priority = (byte) (RANDOM.nextInt() & 0x07);
    ByteBuf buf = Unpooled.buffer(SPDY_HEADER_SIZE + length);
    encodeControlFrameHeader(buf, type, flags, length);
    buf.writeInt(streamId);
    buf.writeInt(associatedToStreamId);
    buf.writeByte(priority << 5);
    buf.writeByte(0);
    decoder.decode(buf);
    verify(delegate).readSynStreamFrame(streamId, associatedToStreamId, priority, false, false);
    verify(delegate).readHeaderBlockEnd();
    assertFalse(buf.isReadable());
    buf.release();
}