Reduce namespace nesting (ndn::ndncert -> ndncert)

Change-Id: I5b69a2c3673cccdf07ea0ba3a0e7181894328f47
diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 7e321e3..5dbdb3b 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -24,31 +24,28 @@
 #include "requester-request.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(TestForBenchmark, IdentityManagementTimeFixture)
+BOOST_FIXTURE_TEST_SUITE(Benchmark, IdentityManagementTimeFixture)
 
 BOOST_AUTO_TEST_CASE(PacketSize0)
 {
-  name::setConventionEncoding(name::Convention::TYPED);
-
   auto identity = addIdentity(Name("/ndn"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  ndn::util::DummyClientFace face(io, m_keyChain, {true, true});
   ca::CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
   auto profileData = ca.getCaProfileData();
 
-  Interest interest = MetadataObject::makeDiscoveryInterest(Name("/ndn/CA/INFO"));
+  Interest interest = ndn::MetadataObject::makeDiscoveryInterest(Name("/ndn/CA/INFO"));
   // std::cout << "CA Config discovery Interest Size: " << interest.wireEncode().size() << std::endl;
-  shared_ptr<Interest> infoInterest = nullptr;
+  std::shared_ptr<Interest> infoInterest;
 
   face.setInterestFilter(
-      InterestFilter("/ndn/CA/INFO"),
+      ndn::InterestFilter("/ndn/CA/INFO"),
       [&](const auto&, const Interest& interest) {
         // std::cout << interest.getName() << std::endl;
         if (interest.getName() == profileData.getName()) {
@@ -72,7 +69,7 @@
     else {
       count++;
       // std::cout << "CA Config Data Size: " << response.wireEncode().size() << std::endl;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(ndn::security::verifySignature(response, cert));
       auto contentBlock = response.getContent();
       contentBlock.parse();
       auto caItem = infotlv::decodeDataContent(contentBlock);
@@ -97,25 +94,25 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  ndn::util::DummyClientFace face(io, m_keyChain, {true, true});
   ca::CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   // generate NEW Interest
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
   auto newInterest = state.genNewInterest(Name("/ndn/alice"),
-                                                        time::system_clock::now(),
-                                                          time::system_clock::now() + time::days(1));
+                                          time::system_clock::now(),
+                                          time::system_clock::now() + time::days(1));
 
   // std::cout << "New Interest Size: " << newInterest->wireEncode().size() << std::endl;
 
   // generate CHALLENGE Interest
-  shared_ptr<Interest> challengeInterest = nullptr;
-  shared_ptr<Interest> challengeInterest2 = nullptr;
-  shared_ptr<Interest> challengeInterest3 = nullptr;
+  std::shared_ptr<Interest> challengeInterest;
+  std::shared_ptr<Interest> challengeInterest2;
+  std::shared_ptr<Interest> challengeInterest3;
 
   int count = 0;
   face.onSendData.connect([&](const Data& response) {
@@ -127,7 +124,7 @@
     }
     else if (Name("/ndn/CA/CHALLENGE").isPrefixOf(response.getName()) && count == 0) {
       count++;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(ndn::security::verifySignature(response, cert));
 
       state.onChallengeResponse(response);
       BOOST_CHECK(state.m_status == Status::CHALLENGE);
@@ -137,7 +134,7 @@
     }
     else if (Name("/ndn/CA/CHALLENGE").isPrefixOf(response.getName()) && count == 1) {
       count++;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(ndn::security::verifySignature(response, cert));
 
       state.onChallengeResponse(response);
       BOOST_CHECK(state.m_status == Status::CHALLENGE);
@@ -153,7 +150,7 @@
     else if (Name("/ndn/CA/CHALLENGE").isPrefixOf(response.getName()) && count == 2) {
       // std::cout << "CHALLENGE Data Size: " << response.wireEncode().size() << std::endl;
       count++;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(ndn::security::verifySignature(response, cert));
       state.onChallengeResponse(response);
       BOOST_CHECK(state.m_status == Status::SUCCESS);
     }
@@ -170,8 +167,7 @@
   BOOST_CHECK_EQUAL(count, 3);
 }
 
-BOOST_AUTO_TEST_SUITE_END()  // TestCaConfig
+BOOST_AUTO_TEST_SUITE_END() // Benchmark
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/ca-memory.t.cpp b/tests/unit-tests/ca-memory.t.cpp
index 290e4ca..fd6f9a5 100644
--- a/tests/unit-tests/ca-memory.t.cpp
+++ b/tests/unit-tests/ca-memory.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -22,7 +22,6 @@
 #include "detail/ca-sqlite.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
@@ -93,8 +92,7 @@
   BOOST_CHECK_EQUAL(allRequests.size(), 1);
 }
 
-BOOST_AUTO_TEST_SUITE_END()  // TestCaModule
+BOOST_AUTO_TEST_SUITE_END() // TestCaMemory
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index 385f7ef..d4a733d 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -26,17 +26,18 @@
 #include "requester-request.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
 using namespace ca;
+using ndn::util::DummyClientFace;
+using ndn::security::verifySignature;
 
 BOOST_FIXTURE_TEST_SUITE(TestCaModule, DatabaseFixture)
 
 BOOST_AUTO_TEST_CASE(Initialization)
 {
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   BOOST_CHECK_EQUAL(ca.getCaConf().caProfile.caPrefix, "/ndn");
 
@@ -47,22 +48,20 @@
 
 BOOST_AUTO_TEST_CASE(HandleProfileFetching)
 {
-  name::setConventionEncoding(name::Convention::TYPED);
-
   auto identity = addIdentity(Name("/ndn"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
   auto profileData = ca.getCaProfileData();
 
-  Interest interest = MetadataObject::makeDiscoveryInterest(Name("/ndn/CA/INFO"));
-  shared_ptr<Interest> infoInterest = nullptr;
+  Interest interest = ndn::MetadataObject::makeDiscoveryInterest(Name("/ndn/CA/INFO"));
+  std::shared_ptr<Interest> infoInterest = nullptr;
 
   face.setInterestFilter(
-      InterestFilter("/ndn/CA/INFO"),
+      ndn::InterestFilter("/ndn/CA/INFO"),
       [&](const auto&, const Interest& interest) {
         if (interest.getName() == profileData.getName()) {
           face.put(profileData);
@@ -77,12 +76,12 @@
       count++;
       auto block = response.getContent();
       block.parse();
-      infoInterest =std::make_shared<Interest>(Name(block.get(ndn::tlv::Name)).appendSegment(0));
+      infoInterest = std::make_shared<Interest>(Name(block.get(ndn::tlv::Name)).appendSegment(0));
       infoInterest->setCanBePrefix(false);
     }
     else {
       count++;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(verifySignature(response, cert));
       auto contentBlock = response.getContent();
       contentBlock.parse();
       auto caItem = infotlv::decodeDataContent(contentBlock);
@@ -107,16 +106,16 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   Interest interest("/ndn/CA/PROBE");
   interest.setCanBePrefix(false);
 
-  Block paramTLV = makeEmptyBlock(ndn::tlv::ApplicationParameters);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, "name"));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "zhiyi"));
+  Block paramTLV = ndn::makeEmptyBlock(ndn::tlv::ApplicationParameters);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, "name"));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "zhiyi"));
   paramTLV.encode();
 
   interest.setApplicationParameters(paramTLV);
@@ -124,7 +123,7 @@
   int count = 0;
   face.onSendData.connect([&](const Data& response) {
     count++;
-    BOOST_CHECK(security::verifySignature(response, cert));
+    BOOST_CHECK(verifySignature(response, cert));
     Block contentBlock = response.getContent();
     contentBlock.parse();
     Block probeResponse = contentBlock.get(tlv::ProbeResponse);
@@ -145,16 +144,16 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   Interest interest("/ndn/CA/PROBE");
   interest.setCanBePrefix(false);
 
-  Block paramTLV = makeEmptyBlock(ndn::tlv::ApplicationParameters);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, "name"));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "zhiyi"));
+  Block paramTLV = ndn::makeEmptyBlock(ndn::tlv::ApplicationParameters);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, "name"));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "zhiyi"));
   paramTLV.encode();
 
   interest.setApplicationParameters(paramTLV);
@@ -162,7 +161,7 @@
   int count = 0;
   face.onSendData.connect([&](const Data& response) {
     count++;
-    BOOST_CHECK(security::verifySignature(response, cert));
+    BOOST_CHECK(verifySignature(response, cert));
     auto contentBlock = response.getContent();
     contentBlock.parse();
     auto probeResponseBlock = contentBlock.get(tlv::ProbeResponse);
@@ -183,16 +182,16 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-5", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   Interest interest("/ndn/CA/PROBE");
   interest.setCanBePrefix(false);
 
-  Block paramTLV = makeEmptyBlock(ndn::tlv::ApplicationParameters);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, "name"));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "zhiyi"));
+  Block paramTLV = ndn::makeEmptyBlock(ndn::tlv::ApplicationParameters);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, "name"));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "zhiyi"));
   paramTLV.encode();
 
   interest.setApplicationParameters(paramTLV);
@@ -200,7 +199,7 @@
   int count = 0;
   face.onSendData.connect([&](const Data& response) {
     count++;
-    BOOST_CHECK(security::verifySignature(response, cert));
+    BOOST_CHECK(verifySignature(response, cert));
     Block contentBlock = response.getContent();
     contentBlock.parse();
 
@@ -212,8 +211,8 @@
       }
     }
     BOOST_CHECK_EQUAL(redirectionItems.size(), 2);
-    BOOST_CHECK_EQUAL(security::extractIdentityFromCertName(redirectionItems[0].getPrefix(-1)), "/ndn/site1");
-    BOOST_CHECK_EQUAL(security::extractIdentityFromCertName(redirectionItems[1].getPrefix(-1)), "/ndn/site1");
+    BOOST_CHECK_EQUAL(ndn::security::extractIdentityFromCertName(redirectionItems[0].getPrefix(-1)), "/ndn/site1");
+    BOOST_CHECK_EQUAL(ndn::security::extractIdentityFromCertName(redirectionItems[1].getPrefix(-1)), "/ndn/site1");
   });
   face.receive(interest);
   advanceClocks(time::milliseconds(20), 60);
@@ -226,13 +225,13 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
   auto interest = state.genNewInterest(Name("/ndn/zhiyi"),
                                        time::system_clock::now(),
@@ -241,7 +240,7 @@
   int count = 0;
   face.onSendData.connect([&](const Data& response) {
     count++;
-    BOOST_CHECK(security::verifySignature(response, cert));
+    BOOST_CHECK(verifySignature(response, cert));
     auto contentBlock = response.getContent();
     contentBlock.parse();
 
@@ -277,13 +276,13 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1");
   advanceClocks(time::milliseconds(20), 60);
 
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
   auto current_tp = time::system_clock::now();
   auto interest1 = state.genNewInterest(Name("/ndn/zhiyi"), current_tp, current_tp - time::hours(1));
@@ -308,22 +307,23 @@
   auto key = identity.getDefaultKey();
 
   //build expired cert
-  security::Certificate cert;
+  Certificate cert;
   cert.setName(Name(key.getName()).append("self-sign").appendVersion());
   cert.setContentType(ndn::tlv::ContentType_Key);
   cert.setContent(key.getPublicKey().data(), key.getPublicKey().size());
   SignatureInfo signatureInfo;
-  signatureInfo.setValidityPeriod(security::ValidityPeriod(time::system_clock::now() - time::days(1), time::system_clock::now() - time::seconds(1)));
+  signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now() - time::days(1),
+                                                                time::system_clock::now() - time::seconds(1)));
   m_keyChain.sign(cert, signingByKey(key.getName()).setSignatureInfo(signatureInfo));
   m_keyChain.setDefaultCertificate(key, cert);
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
   auto interest = state.genNewInterest(Name("/ndn/zhiyi"),
                                        time::system_clock::now(),
@@ -349,13 +349,13 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
 
   auto interest1 = state.genNewInterest(Name("/ndn/a"), time::system_clock::now(),
@@ -374,8 +374,7 @@
     }
     else {
       // should successfully get responses
-      BOOST_CHECK_EXCEPTION(readNonNegativeInteger(contentTlv.get(tlv::ErrorCode)), std::runtime_error,
-                            [](const auto& e) { return true; });
+      BOOST_CHECK_THROW(readNonNegativeInteger(contentTlv.get(tlv::ErrorCode)), std::runtime_error);
     }
   });
   face.receive(*interest1);
@@ -390,13 +389,13 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1");
   advanceClocks(time::milliseconds(20), 60);
 
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
 
   auto current_tp = time::system_clock::now();
@@ -420,23 +419,23 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  DummyClientFace face(io, m_keyChain, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   // generate NEW Interest
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
 
   auto newInterest = state.genNewInterest(Name("/ndn/zhiyi"), time::system_clock::now(),
                                                 time::system_clock::now() + time::days(1));
 
   // generate CHALLENGE Interest
-  shared_ptr<Interest> challengeInterest = nullptr;
-  shared_ptr<Interest> challengeInterest2 = nullptr;
-  shared_ptr<Interest> challengeInterest3 = nullptr;
+  std::shared_ptr<Interest> challengeInterest;
+  std::shared_ptr<Interest> challengeInterest2;
+  std::shared_ptr<Interest> challengeInterest3;
 
   int count = 0;
   face.onSendData.connect([&](const Data& response) {
@@ -447,7 +446,7 @@
     }
     else if (Name("/ndn/CA/CHALLENGE").isPrefixOf(response.getName()) && count == 0) {
       count++;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(verifySignature(response, cert));
 
       state.onChallengeResponse(response);
       BOOST_CHECK(state.m_status == Status::CHALLENGE);
@@ -457,7 +456,7 @@
     }
     else if (Name("/ndn/CA/CHALLENGE").isPrefixOf(response.getName()) && count == 1) {
       count++;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(verifySignature(response, cert));
 
       state.onChallengeResponse(response);
       BOOST_CHECK(state.m_status == Status::CHALLENGE);
@@ -471,7 +470,7 @@
     }
     else if (Name("/ndn/CA/CHALLENGE").isPrefixOf(response.getName()) && count == 2) {
       count++;
-      BOOST_CHECK(security::verifySignature(response, cert));
+      BOOST_CHECK(verifySignature(response, cert));
       state.onChallengeResponse(response);
       BOOST_CHECK(state.m_status == Status::SUCCESS);
     }
@@ -494,21 +493,21 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, {true, true});
+  DummyClientFace face(io, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   //generate a certificate
   auto clientIdentity = m_keyChain.createIdentity("/ndn/qwerty");
   auto clientKey = clientIdentity.getDefaultKey();
-  security::Certificate clientCert;
+  Certificate clientCert;
   clientCert.setName(Name(clientKey.getName()).append("cert-request").appendVersion());
   clientCert.setContentType(ndn::tlv::ContentType_Key);
   clientCert.setFreshnessPeriod(time::hours(24));
   clientCert.setContent(clientKey.getPublicKey().data(), clientKey.getPublicKey().size());
   SignatureInfo signatureInfo;
-  signatureInfo.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
-                                                           time::system_clock::now() + time::hours(10)));
+  signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
+                                                                time::system_clock::now() + time::hours(10)));
   m_keyChain.sign(clientCert, signingByKey(clientKey.getName()).setSignatureInfo(signatureInfo));
   RequestId requestId = {{101}};
   RequestState certRequest;
@@ -521,7 +520,7 @@
 
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::REVOKE);
 
   auto interest = state.genRevokeInterest(issuedCert);
@@ -529,7 +528,7 @@
   int count = 0;
   face.onSendData.connect([&](const Data& response) {
     count++;
-    BOOST_CHECK(security::verifySignature(response, cert));
+    BOOST_CHECK(verifySignature(response, cert));
     auto contentBlock = response.getContent();
     contentBlock.parse();
 
@@ -565,26 +564,26 @@
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
 
-  util::DummyClientFace face(io, {true, true});
+  DummyClientFace face(io, {true, true});
   CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
   advanceClocks(time::milliseconds(20), 60);
 
   // generate a certificate
   auto clientIdentity = m_keyChain.createIdentity("/ndn/qwerty");
   auto clientKey = clientIdentity.getDefaultKey();
-  security::Certificate clientCert;
-  clientCert.setName(Name(clientKey.getName()).append("NDNCERT").append(std::to_string(1473283247810732701)));
+  Certificate clientCert;
+  clientCert.setName(Name(clientKey.getName()).append("NDNCERT").append("1473283247810732701"));
   clientCert.setContentType(ndn::tlv::ContentType_Key);
   clientCert.setFreshnessPeriod(time::hours(24));
   clientCert.setContent(clientKey.getPublicKey().data(), clientKey.getPublicKey().size());
   SignatureInfo signatureInfo;
-  signatureInfo.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
-                                                           time::system_clock::now() + time::hours(10)));
+  signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
+                                                                time::system_clock::now() + time::hours(10)));
   m_keyChain.sign(clientCert, signingByKey(clientKey.getName()).setSignatureInfo(signatureInfo));
 
   CaProfile item;
   item.caPrefix = Name("/ndn");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   requester::Request state(m_keyChain, item, RequestType::NEW);
 
   auto interest = state.genRevokeInterest(clientCert);
@@ -602,8 +601,7 @@
   BOOST_CHECK_EQUAL(receiveData, true);
 }
 
-BOOST_AUTO_TEST_SUITE_END()  // TestCaModule
+BOOST_AUTO_TEST_SUITE_END() // TestCaModule
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/ca-sqlite.t.cpp b/tests/unit-tests/ca-sqlite.t.cpp
index 78077db..c592d47 100644
--- a/tests/unit-tests/ca-sqlite.t.cpp
+++ b/tests/unit-tests/ca-sqlite.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -21,7 +21,6 @@
 #include "detail/ca-sqlite.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
@@ -130,8 +129,7 @@
   BOOST_CHECK_THROW(storage.addRequest(request1), std::runtime_error);
 }
 
-BOOST_AUTO_TEST_SUITE_END() // TestCaModule
+BOOST_AUTO_TEST_SUITE_END() // TestCaSqlite
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/challenge-email.t.cpp b/tests/unit-tests/challenge-email.t.cpp
index 8ee9be9..92fb45b 100644
--- a/tests/unit-tests/challenge-email.t.cpp
+++ b/tests/unit-tests/challenge-email.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -21,7 +21,6 @@
 #include "challenge/challenge-email.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
@@ -52,9 +51,9 @@
   request.requestType = RequestType::NEW;
   request.cert = cert;
 
-  Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "zhiyi@cs.ucla.edu"));
+  Block paramTLV = ndn::makeEmptyBlock(tlv::EncryptedPayload);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "zhiyi@cs.ucla.edu"));
 
   ChallengeEmail challenge("./tests/unit-tests/test-send-email.sh");
   challenge.handleChallengeRequest(paramTLV, request);
@@ -106,9 +105,9 @@
   request.requestType = RequestType::NEW;
   request.cert = cert;
 
-  Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "zhiyi@cs"));
+  Block paramTLV = ndn::makeEmptyBlock(tlv::EncryptedPayload);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "zhiyi@cs"));
 
   ChallengeEmail challenge;
   challenge.handleChallengeRequest(paramTLV, request);
@@ -136,9 +135,9 @@
   request.challengeState = ca::ChallengeState(ChallengeEmail::NEED_CODE, time::system_clock::now(),
                                               3, time::seconds(3600), std::move(secret));
 
-  Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_CODE));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "4567"));
+  Block paramTLV = ndn::makeEmptyBlock(tlv::EncryptedPayload);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_CODE));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "4567"));
 
   ChallengeEmail challenge;
   challenge.handleChallengeRequest(paramTLV, request);
@@ -165,9 +164,9 @@
   request.challengeState = ca::ChallengeState(ChallengeEmail::NEED_CODE, time::system_clock::now(),
                                               3, time::seconds(3600), std::move(secret));
 
-  Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_CODE));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "7890"));
+  Block paramTLV = ndn::makeEmptyBlock(tlv::EncryptedPayload);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_CODE));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "7890"));
 
   ChallengeEmail challenge;
   challenge.handleChallengeRequest(paramTLV, request);
@@ -177,8 +176,7 @@
   BOOST_CHECK_EQUAL(request.challengeState->secrets.empty(), false);
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestChallengeEmail
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/challenge-pin.t.cpp b/tests/unit-tests/challenge-pin.t.cpp
index 61167d0..b835089 100644
--- a/tests/unit-tests/challenge-pin.t.cpp
+++ b/tests/unit-tests/challenge-pin.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -21,7 +21,6 @@
 #include "challenge/challenge-pin.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
@@ -46,7 +45,7 @@
   request.cert = cert;
 
   ChallengePin challenge;
-  challenge.handleChallengeRequest(makeEmptyBlock(tlv::EncryptedPayload), request);
+  challenge.handleChallengeRequest(ndn::makeEmptyBlock(tlv::EncryptedPayload), request);
 
   BOOST_CHECK(request.status == Status::CHALLENGE);
   BOOST_CHECK_EQUAL(request.challengeState->challengeStatus, ChallengePin::NEED_CODE);
@@ -71,9 +70,9 @@
   request.challengeState = ca::ChallengeState(ChallengePin::NEED_CODE, time::system_clock::now(),
                                               3, time::seconds(3600), std::move(secret));
 
-  Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengePin::PARAMETER_KEY_CODE));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "12345"));
+  Block paramTLV = ndn::makeEmptyBlock(tlv::EncryptedPayload);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, ChallengePin::PARAMETER_KEY_CODE));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "12345"));
 
   ChallengePin challenge;
   challenge.handleChallengeRequest(paramTLV, request);
@@ -100,9 +99,9 @@
   request.challengeState = ca::ChallengeState(ChallengePin::NEED_CODE, time::system_clock::now(),
                                               3, time::seconds(3600), std::move(secret));
 
-  Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
-  paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengePin::PARAMETER_KEY_CODE));
-  paramTLV.push_back(makeStringBlock(tlv::ParameterValue, "45678"));
+  Block paramTLV = ndn::makeEmptyBlock(tlv::EncryptedPayload);
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterKey, ChallengePin::PARAMETER_KEY_CODE));
+  paramTLV.push_back(ndn::makeStringBlock(tlv::ParameterValue, "45678"));
 
   ChallengePin challenge;
   challenge.handleChallengeRequest(paramTLV, request);
@@ -112,8 +111,7 @@
   BOOST_CHECK_EQUAL(request.challengeState->secrets.empty(), false);
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestChallengePin
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/challenge-possession.t.cpp b/tests/unit-tests/challenge-possession.t.cpp
index 84d05d5..2c76c3d 100644
--- a/tests/unit-tests/challenge-possession.t.cpp
+++ b/tests/unit-tests/challenge-possession.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -19,14 +19,13 @@
  */
 
 #include "challenge/challenge-possession.hpp"
-#include "test-common.hpp"
 #include "detail/challenge-encoder.hpp"
+#include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(TestChallengeCredential, IdentityManagementFixture)
+BOOST_FIXTURE_TEST_SUITE(TestChallengePossession, IdentityManagementFixture)
 
 BOOST_AUTO_TEST_CASE(LoadConfig)
 {
@@ -65,12 +64,12 @@
   auto identityB = addIdentity(Name("/trust/cert"));
   auto keyB = identityB.getDefaultKey();
   auto credentialName = Name(keyB.getName()).append("Credential").appendVersion();
-  security::Certificate credential;
+  Certificate credential;
   credential.setName(credentialName);
   credential.setContent(keyB.getPublicKey().data(), keyB.getPublicKey().size());
   SignatureInfo signatureInfo;
-  signatureInfo.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(), time::system_clock::now() +
-                                  time::minutes(1)));
+  signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
+                                                                time::system_clock::now() + time::minutes(1)));
   m_keyChain.sign(credential, signingByCertificate(trustAnchor).setSignatureInfo(signatureInfo));
   m_keyChain.addCertificate(keyB, credential);
 
@@ -83,7 +82,7 @@
   BOOST_CHECK_EQUAL(state.challengeState->challengeStatus, "need-proof");
 
   // reply from server
-  auto nonceBuf = fromHex(state.challengeState->secrets.get("nonce", ""));
+  auto nonceBuf = ndn::fromHex(state.challengeState->secrets.get("nonce", ""));
   std::array<uint8_t, 16> nonce{};
   memcpy(nonce.data(), nonceBuf->data(), 16);
   auto params2 = challenge.getRequestedParameterList(state.status, state.challengeState->challengeStatus);
@@ -118,12 +117,12 @@
   auto identityB = addIdentity(Name("/trust/cert"));
   auto keyB = identityB.getDefaultKey();
   auto credentialName = Name(keyB.getName()).append("Credential").appendVersion();
-  security::Certificate credential;
+  Certificate credential;
   credential.setName(credentialName);
   credential.setContent(keyB.getPublicKey().data(), keyB.getPublicKey().size());
   SignatureInfo signatureInfo;
-  signatureInfo.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(), time::system_clock::now() +
-                                                                                        time::minutes(1)));
+  signatureInfo.setValidityPeriod(ndn::security::ValidityPeriod(time::system_clock::now(),
+                                                                time::system_clock::now() + time::minutes(1)));
   m_keyChain.sign(credential, signingByCertificate(trustAnchor).setSignatureInfo(signatureInfo));
   m_keyChain.addCertificate(keyB, credential);
 
@@ -144,8 +143,7 @@
   BOOST_CHECK_EQUAL(statusToString(state.status), statusToString(Status::FAILURE));
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestChallengePossession
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/configuration.t.cpp b/tests/unit-tests/configuration.t.cpp
index 20748d9..f7a8bc5 100644
--- a/tests/unit-tests/configuration.t.cpp
+++ b/tests/unit-tests/configuration.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -23,13 +23,12 @@
 #include "detail/info-encoder.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
 BOOST_FIXTURE_TEST_SUITE(TestConfig, IdentityManagementFixture)
 
-BOOST_AUTO_TEST_CASE(CAConfigFile)
+BOOST_AUTO_TEST_CASE(CaConfigFile)
 {
   ca::CaConfig config;
   config.load("tests/unit-tests/config-files/config-ca-1");
@@ -73,7 +72,7 @@
   BOOST_CHECK_EQUAL(names[2].size(), 1);
 }
 
-BOOST_AUTO_TEST_CASE(CAConfigFileWithErrors)
+BOOST_AUTO_TEST_CASE(CaConfigFileWithErrors)
 {
   ca::CaConfig config;
   // nonexistent file
@@ -143,8 +142,7 @@
   BOOST_CHECK_EQUAL(lastItem.caPrefix, "/ndn/edu/ucla/zhiyi");
 }
 
-BOOST_AUTO_TEST_SUITE_END()  // TestCaConfig
+BOOST_AUTO_TEST_SUITE_END() // TestConfig
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/crypto-helpers.t.cpp b/tests/unit-tests/crypto-helpers.t.cpp
index 9025da0..008a2f6 100644
--- a/tests/unit-tests/crypto-helpers.t.cpp
+++ b/tests/unit-tests/crypto-helpers.t.cpp
@@ -21,7 +21,6 @@
 #include "detail/crypto-helpers.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
@@ -281,7 +280,7 @@
                                         (uint8_t*)associatedData.c_str(), associatedData.size(), encryptionIv);
   block.parse();
   auto ivBlock = block.get(tlv::InitializationVector);
-  Buffer ivBuf(ivBlock.value(), ivBlock.value_size());
+  ndn::Buffer ivBuf(ivBlock.value(), ivBlock.value_size());
   BOOST_CHECK_EQUAL(ivBuf.size(), 12);
   BOOST_CHECK_EQUAL(loadBigU32(&encryptionIv[8]), 6);
   BOOST_CHECK_EQUAL(loadBigU32(&ivBuf[8]), 0);
@@ -290,7 +289,7 @@
                                    (uint8_t*)associatedData.c_str(), associatedData.size(), encryptionIv);
   block.parse();
   ivBlock = block.get(tlv::InitializationVector);
-  Buffer ivBuf2(ivBlock.value(), ivBlock.value_size());
+  ndn::Buffer ivBuf2(ivBlock.value(), ivBlock.value_size());
   BOOST_CHECK_EQUAL(std::memcmp(ivBuf2.data(), encryptionIv.data(), 8), 0);
 }
 
@@ -338,8 +337,7 @@
                     std::runtime_error);
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestCryptoHelpers
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/name-assignment.t.cpp b/tests/unit-tests/name-assignment.t.cpp
index 425e513..94b7fef 100644
--- a/tests/unit-tests/name-assignment.t.cpp
+++ b/tests/unit-tests/name-assignment.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -23,11 +23,11 @@
 #include "name-assignment/assignment-hash.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(TestNameAssignment)
+
 BOOST_AUTO_TEST_CASE(NameAssignmentRandom)
 {
   AssignmentRandom assignment;
@@ -68,10 +68,7 @@
   BOOST_CHECK_EQUAL(assignment.assignName(params).begin()->size(), 2);
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestNameAssignment
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
-
-
diff --git a/tests/unit-tests/protocol-encoders.t.cpp b/tests/unit-tests/protocol-encoders.t.cpp
index 61128e3..bc1daa0 100644
--- a/tests/unit-tests/protocol-encoders.t.cpp
+++ b/tests/unit-tests/protocol-encoders.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2017-2020, Regents of the University of California.
+/*
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -25,9 +25,7 @@
 #include "detail/probe-encoder.hpp"
 #include "detail/ca-configuration.hpp"
 #include "test-common.hpp"
-#include "identity-management-fixture.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
@@ -108,7 +106,7 @@
   std::vector<uint8_t> pub = ECDHState().getSelfPubKey();
   auto b = requesttlv::encodeApplicationParameters(RequestType::REVOKE, pub, *certRequest);
   std::vector<uint8_t> returnedPub;
-  std::shared_ptr<security::Certificate> returnedCert;
+  std::shared_ptr<Certificate> returnedCert;
   requesttlv::decodeApplicationParameters(b, RequestType::REVOKE, returnedPub, returnedCert);
 
   BOOST_CHECK_EQUAL(returnedPub.size(), pub.size());
@@ -143,7 +141,7 @@
                          0xe0, 0xff, 0x56, 0x83, 0xf2, 0x43, 0xb2, 0x13};
   requester::ProfileStorage caCache;
   caCache.load("tests/unit-tests/config-files/config-client-1");
-  security::Certificate certRequest = *caCache.getKnownProfiles().front().cert;
+  auto certRequest = *caCache.getKnownProfiles().front().cert;
   RequestId id = {{102}};
   ca::RequestState state;
   state.caPrefix = Name("/ndn/ucla");
@@ -170,8 +168,7 @@
   BOOST_CHECK_EQUAL(context.m_issuedCertName, "/ndn/ucla/a/b/c");
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestProtocolEncoding
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn
diff --git a/tests/unit-tests/requester.t.cpp b/tests/unit-tests/requester.t.cpp
index 1f07a3f..d2833c4 100644
--- a/tests/unit-tests/requester.t.cpp
+++ b/tests/unit-tests/requester.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2017-2020, Regents of the University of California.
+ * Copyright (c) 2017-2021, Regents of the University of California.
  *
  * This file is part of ndncert, a certificate management system based on NDN.
  *
@@ -25,7 +25,6 @@
 #include "ca-module.hpp"
 #include "test-common.hpp"
 
-namespace ndn {
 namespace ndncert {
 namespace tests {
 
@@ -33,7 +32,6 @@
 
 BOOST_FIXTURE_TEST_SUITE(TestRequester, IdentityManagementTimeFixture)
 
-/* PROBE */
 BOOST_AUTO_TEST_CASE(GenProbeInterest)
 {
   auto identity = addIdentity(Name("/site"));
@@ -45,7 +43,7 @@
   ca_profile.probeParameterKeys.push_back("uid");
   ca_profile.probeParameterKeys.push_back("name");
   ca_profile.caPrefix = Name("/site");
-  ca_profile.cert = std::make_shared<security::Certificate>(cert);
+  ca_profile.cert = std::make_shared<Certificate>(cert);
 
   std::multimap<std::string, std::string> probeParams;
   probeParams.emplace("email", "zhiyi@cs.ucla.edu");
@@ -69,20 +67,20 @@
   ca_profile.probeParameterKeys.push_back("uid");
   ca_profile.probeParameterKeys.push_back("name");
   ca_profile.caPrefix = Name("/site");
-  ca_profile.cert = std::make_shared<security::Certificate>(cert);
+  ca_profile.cert = std::make_shared<Certificate>(cert);
 
   std::vector<Name> availableNames;
   availableNames.push_back(Name("/site1"));
   availableNames.push_back(Name("/site2"));
 
-  util::DummyClientFace face(io, m_keyChain, {true, true});
+  ndn::util::DummyClientFace face(io, m_keyChain, {true, true});
   ca::CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-5", "ca-storage-memory");
 
   Data reply;
   reply.setName(Name("/site/CA/PROBE"));
   reply.setFreshnessPeriod(time::seconds(100));
   reply.setContent(probetlv::encodeDataContent(availableNames, 3, ca.m_config.redirection));
-  m_keyChain.sign(reply, signingByIdentity(identity));
+  m_keyChain.sign(reply, ndn::signingByIdentity(identity));
 
   std::vector<std::pair<Name, int>> names;
   std::vector<Name> redirects;
@@ -96,8 +94,8 @@
   BOOST_CHECK_EQUAL(names[1].second, 3);
 
   BOOST_CHECK_EQUAL(redirects.size(), 2);
-  BOOST_CHECK_EQUAL(security::extractIdentityFromCertName(redirects[0].getPrefix(-1)), "/ndn/site1");
-  BOOST_CHECK_EQUAL(security::extractIdentityFromCertName(redirects[1].getPrefix(-1)), "/ndn/site1");
+  BOOST_CHECK_EQUAL(ndn::security::extractIdentityFromCertName(redirects[0].getPrefix(-1)), "/ndn/site1");
+  BOOST_CHECK_EQUAL(ndn::security::extractIdentityFromCertName(redirects[1].getPrefix(-1)), "/ndn/site1");
 }
 
 BOOST_AUTO_TEST_CASE(ErrorHandling)
@@ -108,14 +106,14 @@
 
   CaProfile item;
   item.caPrefix = Name("/site");
-  item.cert = std::make_shared<security::Certificate>(cert);
+  item.cert = std::make_shared<Certificate>(cert);
   Request state(m_keyChain, item, RequestType::NEW);
 
   Data errorPacket;
   errorPacket.setName(Name("/site/pretend/this/is/error/packet"));
   errorPacket.setFreshnessPeriod(time::seconds(100));
   errorPacket.setContent(errortlv::encodeDataContent(ErrorCode::INVALID_PARAMETER, "This is a test."));
-  m_keyChain.sign(errorPacket, signingByIdentity(identity));
+  m_keyChain.sign(errorPacket, ndn::signingByIdentity(identity));
 
   std::vector<std::pair<Name, int>> ids;
   std::vector<Name> cas;
@@ -128,4 +126,3 @@
 
 } // namespace tests
 } // namespace ndncert
-} // namespace ndn