diff --git a/tests/chunks/consumer.t.cpp b/tests/chunks/consumer.t.cpp
index 32e6914..205cfb3 100644
--- a/tests/chunks/consumer.t.cpp
+++ b/tests/chunks/consumer.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2016-2020, Regents of the University of California,
+ * Copyright (c) 2016-2022, Regents of the University of California,
  *                          Colorado State University,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
@@ -75,8 +75,8 @@
     output.flush();
 
     auto data = makeData(Name(name).appendVersion(1).appendSegment(i));
-    data->setContent(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
-                     testStrings[i].size());
+    data->setContent(make_span(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
+                               testStrings[i].size()));
 
     cons.m_bufferedData[i] = data;
     cons.writeInOrderData();
@@ -109,8 +109,8 @@
 
   for (size_t i = 0; i < testStrings.size(); ++i) {
     auto data = makeData(Name(name).appendVersion(1).appendSegment(i));
-    data->setContent(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
-                     testStrings[i].size());
+    data->setContent(make_span(reinterpret_cast<const uint8_t*>(testStrings[i].data()),
+                               testStrings[i].size()));
 
     dataStore.push_back(data);
   }
diff --git a/tests/dump/ndndump.t.cpp b/tests/dump/ndndump.t.cpp
index f266d92..217dc10 100644
--- a/tests/dump/ndndump.t.cpp
+++ b/tests/dump/ndndump.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020, University of Memphis,
+ * Copyright (c) 2014-2022, University of Memphis,
  *                          University Pierre & Marie Curie, Sorbonne University.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
@@ -87,9 +87,9 @@
     ethernet::Address host;
 
     // Ethernet header
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(&ethertype), ethernet::TYPE_LEN);
-    buffer.prependByteArray(host.data(), host.size());
-    buffer.prependByteArray(host.data(), host.size());
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(&ethertype), ethernet::TYPE_LEN});
+    buffer.prependBytes(host);
+    buffer.prependBytes(host);
 
     // pcap header
     pcap_pkthdr pkthdr{};
@@ -97,28 +97,28 @@
 
     {
       StdCoutRedirector redirect(output);
-      dump.printPacket(&pkthdr, buffer.buf());
+      dump.printPacket(&pkthdr, buffer.data());
     }
   }
 
   void
   receiveIp4(EncodingBuffer& buffer, const ip* ipHeader)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(ipHeader), sizeof(ip));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(ipHeader), sizeof(ip)});
     receiveEthernet(buffer, s_ethertypeIp4);
   }
 
   void
   receiveIp6(EncodingBuffer& buffer, const ip6_hdr* ip6Header)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(ip6Header), sizeof(ip6_hdr));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(ip6Header), sizeof(ip6_hdr)});
     receiveEthernet(buffer, s_ethertypeIp6);
   }
 
   void
   receiveTcp4(EncodingBuffer& buffer, const tcphdr* tcpHeader)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(tcpHeader), sizeof(tcphdr));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(tcpHeader), sizeof(tcphdr)});
 
     ip ipHeader{};
     ipHeader.ip_v = 4;
@@ -133,7 +133,7 @@
   void
   receiveUdp4(EncodingBuffer& buffer, const udphdr* udpHeader)
   {
-    buffer.prependByteArray(reinterpret_cast<const uint8_t*>(udpHeader), sizeof(udphdr));
+    buffer.prependBytes({reinterpret_cast<const uint8_t*>(udpHeader), sizeof(udphdr)});
 
     ip ipHeader{};
     ipHeader.ip_v = 4;
@@ -238,7 +238,7 @@
       0x00, 0x00, 0x00, 0x01
   };
   EncodingBuffer buffer;
-  buffer.prependByteArray(interest, 4);
+  buffer.prependBytes(make_span(interest).first(4));
 
   this->receiveEthernet(buffer);
   BOOST_CHECK(output.is_equal("0.000000 Ethernet, NDN truncated packet, length 4\n"));
@@ -268,7 +268,7 @@
   uint8_t theAnswer = 42;
 
   EncodingBuffer pkt1;
-  pkt1.prependByte(theAnswer);
+  pkt1.prependBytes({theAnswer});
   this->receiveEthernet(pkt1, s_ethertypeIp4);
   BOOST_CHECK(output.is_equal("IP truncated header, length 1\n"));
 
@@ -315,7 +315,7 @@
   uint8_t theAnswer = 42;
 
   EncodingBuffer pkt1;
-  pkt1.prependByte(theAnswer);
+  pkt1.prependBytes({theAnswer});
   this->receiveEthernet(pkt1, s_ethertypeIp6);
   BOOST_CHECK(output.is_equal("IP6 truncated header, length 1\n"));
 
diff --git a/tests/key-chain-fixture.cpp b/tests/key-chain-fixture.cpp
index b4911df..283c7bc 100644
--- a/tests/key-chain-fixture.cpp
+++ b/tests/key-chain-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California.
+ * Copyright (c) 2014-2022,  Regents of the University of California.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -54,7 +54,7 @@
   cert.setFreshnessPeriod(1_h);
 
   // set content
-  cert.setContent(key.getPublicKey().data(), key.getPublicKey().size());
+  cert.setContent(key.getPublicKey());
 
   // set signature info
   ndn::SignatureInfo info;
diff --git a/tests/peek/ndnpeek.t.cpp b/tests/peek/ndnpeek.t.cpp
index 336b1de..dfb8768 100644
--- a/tests/peek/ndnpeek.t.cpp
+++ b/tests/peek/ndnpeek.t.cpp
@@ -143,8 +143,7 @@
   initialize(options);
 
   auto data = makeData(options.name);
-  const std::string payload = "NdnPeekTest";
-  data->setContent(reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
+  data->setContent({'n', 'd', 'n', 'p', 'e', 'e', 'k'});
 
   {
     CoutRedirector redir(output);
@@ -177,8 +176,7 @@
 
   auto data = makeData(Name(options.name).append("suffix"));
   data->setFreshnessPeriod(1_s);
-  const std::string payload = "NdnPeekTest";
-  data->setContent(reinterpret_cast<const uint8_t*>(payload.data()), payload.size());
+  data->setContent({'n', 'd', 'n', 'p', 'e', 'e', 'k'});
 
   {
     CoutRedirector redir(output);
