@Test public void parserFrameLengthNegativeFails() throws GeneralSecurityException { AltsFraming.Parser parser = new AltsFraming.Parser(); ByteBuffer buffer = ByteBuffer.allocate(AltsFraming.getFrameLengthHeaderSize() + 1); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.putInt(-1); buffer.put((byte) 0); buffer.flip(); try { parser.readBytes(buffer); fail("Exception expected"); } catch (IllegalArgumentException ex) { assertThat(ex).hasMessageThat().contains("Invalid frame length"); } }
static int getFrameLengthHeaderSize() { return FRAME_LENGTH_HEADER_SIZE; }
AltsFraming { static int getFrameLengthHeaderSize() { return FRAME_LENGTH_HEADER_SIZE; } }
AltsFraming { static int getFrameLengthHeaderSize() { return FRAME_LENGTH_HEADER_SIZE; } private  AltsFraming(); }
AltsFraming { static int getFrameLengthHeaderSize() { return FRAME_LENGTH_HEADER_SIZE; } private  AltsFraming();  }
AltsFraming { static int getFrameLengthHeaderSize() { return FRAME_LENGTH_HEADER_SIZE; } private  AltsFraming();   }