diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index c52c81b..7db02ca 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.cpp
@@ -297,8 +297,7 @@
   BOOST_CHECK_EQUAL(authorize1(
     [] (Interest& interest) {
       ndn::SignatureInfo sigInfo(tlv::SignatureSha256WithRsa);
-      setNameComponent(interest, ndn::signed_interest::POS_SIG_INFO,
-                       sigInfo.wireEncode().begin(), sigInfo.wireEncode().end());
+      setNameComponent(interest, ndn::signed_interest::POS_SIG_INFO, ndn::make_span(sigInfo.wireEncode()));
     }
   ), false);
   BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT);
@@ -313,8 +312,7 @@
                                            {0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD}));
       ndn::SignatureInfo sigInfo(tlv::SignatureSha256WithRsa);
       sigInfo.setKeyLocator(kl);
-      setNameComponent(interest, ndn::signed_interest::POS_SIG_INFO,
-                       sigInfo.wireEncode().begin(), sigInfo.wireEncode().end());
+      setNameComponent(interest, ndn::signed_interest::POS_SIG_INFO, ndn::make_span(sigInfo.wireEncode()));
     }
   ), false);
   BOOST_CHECK(lastRejectReply == ndn::mgmt::RejectReply::SILENT);
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 0e43944..828325f 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -216,18 +216,16 @@
   auto face2 = addFace(REMOVE_LAST_NOTIFICATION | SET_SCOPE_LOCAL); // dummy://, local
   auto face3 = addFace(REMOVE_LAST_NOTIFICATION | SET_URI_TEST); // test://
 
-  auto generateQuery = [] (const FaceQueryFilter& filter) {
-    return Interest(Name("/localhost/nfd/faces/query")
-                    .append(filter.wireEncode().begin(), filter.wireEncode().end()))
+  auto generateQuery = [] (const auto& filter) {
+    return Interest(Name("/localhost/nfd/faces/query").append(tlv::GenericNameComponent, filter.wireEncode()))
            .setCanBePrefix(true);
   };
 
   auto schemeQuery = generateQuery(FaceQueryFilter().setUriScheme("dummy"));
   auto idQuery = generateQuery(FaceQueryFilter().setFaceId(face1->getId()));
   auto scopeQuery = generateQuery(FaceQueryFilter().setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL));
-  auto invalidContent = ndn::makeStringBlock(tlv::Content, "invalid");
   auto invalidQueryName = Name("/localhost/nfd/faces/query")
-                          .append(invalidContent.begin(), invalidContent.end());
+                          .append(tlv::GenericNameComponent, ndn::makeStringBlock(tlv::Content, "invalid"));
   auto invalidQuery = Interest(invalidQueryName).setCanBePrefix(true);
 
   receiveInterest(schemeQuery); // face1 and face2 expected
diff --git a/tests/daemon/mgmt/manager-common-fixture.cpp b/tests/daemon/mgmt/manager-common-fixture.cpp
index db207e9..83136be 100644
--- a/tests/daemon/mgmt/manager-common-fixture.cpp
+++ b/tests/daemon/mgmt/manager-common-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2021,  Regents of the University of California,
+ * Copyright (c) 2014-2022,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -47,7 +47,7 @@
                                                         const ControlParameters& params,
                                                         const Name& identity)
 {
-  commandName.append(params.wireEncode());
+  commandName.append(tlv::GenericNameComponent, params.wireEncode());
   return this->makeCommandInterest(commandName, identity);
 }
 
@@ -155,12 +155,11 @@
   }
 
   ndn::EncodingBuffer encoder;
-  size_t valueLength = 0;
+  size_t length = 0;
   for (size_t i = startIndex; i < endIndex ; i ++) {
-    valueLength += encoder.appendByteArray(m_responses[i].getContent().value(),
-                                           m_responses[i].getContent().value_size());
+    length += encoder.appendBytes(m_responses[i].getContent().value_bytes());
   }
-  encoder.prependVarNumber(valueLength);
+  encoder.prependVarNumber(length);
   encoder.prependVarNumber(tlv::Content);
   return encoder.block();
 }
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 616b6e8..597bad4 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -153,13 +153,11 @@
   std::string
   getIdentityCertificateBase64(const Name& identity) const
   {
-    auto cert = m_keyChain.getPib().getIdentity(identity).getDefaultKey().getDefaultCertificate();
-    const auto& block = cert.wireEncode();
-
     namespace tr = ndn::security::transform;
-    std::ostringstream oss;
-    tr::bufferSource(block.wire(), block.size()) >> tr::base64Encode(false) >> tr::streamSink(oss);
 
+    auto cert = m_keyChain.getPib().getIdentity(identity).getDefaultKey().getDefaultCertificate();
+    std::ostringstream oss;
+    tr::bufferSource(cert.wireEncode()) >> tr::base64Encode(false) >> tr::streamSink(oss);
     return oss.str();
   }
 
