TEST_F(EncryptedRecordTest, TestWriteAppDataInPlace) {
  TLSMessage msg{ContentType::application_data, getBuf("1234567890", 5, 17)};
  EXPECT_CALL(*writeAead_, _encrypt(_, _, 0))
      .WillOnce(Invoke([](std::unique_ptr<IOBuf>& buf, const IOBuf*, uint64_t) {
        // footer should have been written w/o chaining
        EXPECT_FALSE(buf->isChained());
        expectSame(buf, "123456789017");
        // we need to return room for the header
        return getBuf("abcd1234abcd", 5, 0);
      }));
  auto buf = write_.write(std::move(msg));
  EXPECT_FALSE(buf.data->isChained());
  expectSame(buf.data, "1703030006abcd1234abcd");
}
TEST_F(EncryptedRecordTest, TestWriteAppDataInPlace) {
  TLSMessage msg{ContentType::application_data, getBuf("1234567890", 5, 17)};
  EXPECT_CALL(*writeAead_, _encrypt(_, _, 0))
      .WillOnce(Invoke([](std::unique_ptr<IOBuf>& buf, const IOBuf*, uint64_t) {
         
        EXPECT_FALSE(buf->isChained());
        expectSame(buf, "123456789017");
         
        return getBuf("abcd1234abcd", 5, 0);
      }));
  auto buf = write_.write(std::move(msg));
  EXPECT_FALSE(buf.data->isChained());
  expectSame(buf.data, "1703030006abcd1234abcd");
}