diff --git a/tests/communication/test-sync-logic-handler.cpp b/tests/communication/test-sync-logic-handler.cpp
index de99239..bdd8a3e 100644
--- a/tests/communication/test-sync-logic-handler.cpp
+++ b/tests/communication/test-sync-logic-handler.cpp
@@ -23,7 +23,6 @@
 #include "tests/test-common.hpp"
 #include "common.hpp"
 #include "nlsr.hpp"
-#include "lsa.hpp"
 
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
@@ -101,7 +100,7 @@
   uint64_t syncSeqNo = 1;
 
   for (const Lsa::Type& lsaType : lsaTypes) {
-    std::string updateName = this->updateNamePrefix + std::to_string(lsaType);
+    std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(lsaType);
 
     // Actual testing done here -- signal function callback
     ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa->connect(
@@ -127,7 +126,7 @@
   std::vector<Lsa::Type> lsaTypes = {Lsa::Type::NAME, Lsa::Type::COORDINATE};
 
   for (const Lsa::Type& lsaType : lsaTypes) {
-    std::string updateName = this->updateNamePrefix + std::to_string(lsaType);
+    std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(lsaType);
 
     ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa->connect(
       [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber,
@@ -151,7 +150,7 @@
   uint64_t syncSeqNo = 1;
 
   for (const Lsa::Type& lsaType : this->lsaTypes) {
-    std::string updateName = this->updateNamePrefix + std::to_string(lsaType);
+    std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(lsaType);
 
     ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa->connect(
       [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber,
@@ -178,7 +177,7 @@
     ndn::Name updateName = ndn::Name{this->conf.getLsaPrefix()};
     updateName.append(this->conf.getSiteName())
               .append(this->conf.getRouterName())
-              .append(std::to_string(lsaType));
+              .append(boost::lexical_cast<std::string>(lsaType));
 
     ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa->connect(
       [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber,
@@ -200,7 +199,7 @@
 
   for (const Lsa::Type& lsaType : this->lsaTypes) {
     ndn::Name updateName{this->conf.getSiteName()};
-    updateName.append(this->conf.getRouterName()).append(std::to_string(lsaType));
+    updateName.append(this->conf.getRouterName()).append(boost::lexical_cast<std::string>(lsaType));
 
     ndn::util::signal::ScopedConnection connection = this->sync.onNewLsa->connect(
       [&] (const ndn::Name& routerName, const uint64_t& sequenceNumber,
@@ -231,7 +230,7 @@
         BOOST_FAIL("An update for an LSA with non-new sequence number should not emit!");
       });
 
-  std::string updateName = this->updateNamePrefix + std::to_string(Lsa::Type::NAME);
+  std::string updateName = this->updateNamePrefix + boost::lexical_cast<std::string>(Lsa::Type::NAME);
 
   this->receiveUpdate(updateName, sequenceNumber);
 }
@@ -247,11 +246,11 @@
   expectedPrefix.append(this->conf.getRouterName());
 
   BOOST_CHECK_EQUAL(this->sync.m_nameLsaUserPrefix,
-                    ndn::Name(expectedPrefix).append(std::to_string(Lsa::Type::NAME)));
+                    ndn::Name(expectedPrefix).append(boost::lexical_cast<std::string>(Lsa::Type::NAME)));
   BOOST_CHECK_EQUAL(this->sync.m_adjLsaUserPrefix,
-                    ndn::Name(expectedPrefix).append(std::to_string(Lsa::Type::ADJACENCY)));
+                    ndn::Name(expectedPrefix).append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY)));
   BOOST_CHECK_EQUAL(this->sync.m_coorLsaUserPrefix,
-                    ndn::Name(expectedPrefix).append(std::to_string(Lsa::Type::COORDINATE)));
+                    ndn::Name(expectedPrefix).append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE)));
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/mocks/lsa.cpp b/tests/mocks/lsa.cpp
deleted file mode 100644
index a9ea498..0000000
--- a/tests/mocks/lsa.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "./lsa.hpp"
-
-namespace nlsr {
-namespace test {
-
-std::string
-MockLsa::serialize() const
-{
-  return "";
-}
-
-bool
-MockLsa::deserialize(const std::string& content) noexcept
-{
-  boost::char_separator<char> sep("|");
-  boost::tokenizer<boost::char_separator<char> >tokens(content, sep);
-  boost::tokenizer<boost::char_separator<char> >::iterator tok_iter =
-    tokens.begin();
-
-  try {
-    deserializeCommon(tok_iter);
-  }
-  catch (const std::exception& e) {
-    return false;
-  }
-  return true;
-}
-
-void
-MockLsa::writeLog() const
-{
-}
-
-} // namespace test
-} // namespace nlsr
diff --git a/tests/mocks/lsa.hpp b/tests/mocks/lsa.hpp
deleted file mode 100644
index e1ee2aa..0000000
--- a/tests/mocks/lsa.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NLSR_TESTS_MOCKS_LSA_HPP
-#define NLSR_TESTS_MOCKS_LSA_HPP
-
-#include "src/lsa.hpp"
-
-#include <boost/tokenizer.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
-
-namespace nlsr {
-namespace test {
-
-class MockLsa : public Lsa
-{
-public:
-  MockLsa()
-  {
-  }
-
-  std::string
-  serialize() const override;
-
-  bool
-  deserialize(const std::string& content) noexcept override;
-
-  void
-  writeLog() const override;
-};
-
-} // namespace test
-} // namespace nlsr
-
-#endif // NLSR_TESTS_MOCKS_LSA_HPP
diff --git a/tests/publisher/publisher-fixture.hpp b/tests/publisher/publisher-fixture.hpp
index be97a34..18a51f0 100644
--- a/tests/publisher/publisher-fixture.hpp
+++ b/tests/publisher/publisher-fixture.hpp
@@ -64,40 +64,6 @@
     lsa.addAdjacent(std::move(adjacency));
   }
 
-  void
-  checkTlvLsaInfo(const tlv::LsaInfo& info, Lsa& lsa)
-  {
-    BOOST_CHECK_EQUAL(info.getOriginRouter(), lsa.getOrigRouter());
-    BOOST_CHECK_EQUAL(info.getSequenceNumber(), lsa.getLsSeqNo());
-    BOOST_CHECK_LE(info.getExpirationPeriod(), ndn::time::milliseconds(0));
-  }
-
-  void
-  checkTlvAdjLsa(const ndn::Block& block, AdjLsa& lsa)
-  {
-    BOOST_CHECK_EQUAL(block.type(), ndn::tlv::nlsr::AdjacencyLsa);
-
-    tlv::AdjacencyLsa tlvLsa;
-    BOOST_REQUIRE_NO_THROW(tlvLsa.wireDecode(block));
-
-    checkTlvAdjLsa(tlvLsa, lsa);
-  }
-
-  void
-  checkTlvAdjLsa(const tlv::AdjacencyLsa& tlvLsa, AdjLsa& lsa)
-  {
-    checkTlvLsaInfo(tlvLsa.getLsaInfo(), lsa);
-
-    std::list<tlv::Adjacency>::const_iterator it = tlvLsa.getAdjacencies().begin();
-
-    for (const Adjacent& adjacency : lsa.getAdl().getAdjList()) {
-      BOOST_CHECK_EQUAL(it->getName(), adjacency.getName());
-      BOOST_CHECK_EQUAL(it->getUri(), adjacency.getFaceUri().toString());
-      BOOST_CHECK_EQUAL(it->getCost(), adjacency.getLinkCost());
-      ++it;
-    }
-  }
-
   NextHop
   createNextHop(const std::string& faceUri, double cost)
   {
@@ -113,50 +79,6 @@
     return lsa;
   }
 
-  void
-  checkTlvCoordinateLsa(const ndn::Block& block, CoordinateLsa& lsa)
-  {
-    BOOST_CHECK_EQUAL(block.type(), ndn::tlv::nlsr::CoordinateLsa);
-
-    tlv::CoordinateLsa tlvLsa;
-    BOOST_REQUIRE_NO_THROW(tlvLsa.wireDecode(block));
-
-    checkTlvCoordinateLsa(tlvLsa, lsa);
-  }
-
-  void
-  checkTlvCoordinateLsa(const tlv::CoordinateLsa& tlvLsa, CoordinateLsa& lsa)
-  {
-    checkTlvLsaInfo(tlvLsa.getLsaInfo(), lsa);
-
-    BOOST_CHECK_EQUAL(tlvLsa.getHyperbolicRadius(), lsa.getCorRadius());
-    BOOST_CHECK(tlvLsa.getHyperbolicAngle() == lsa.getCorTheta());
-  }
-
-  void
-  checkTlvNameLsa(const ndn::Block& block, NameLsa& lsa)
-  {
-    BOOST_CHECK_EQUAL(block.type(), ndn::tlv::nlsr::NameLsa);
-
-    tlv::NameLsa tlvLsa;
-    BOOST_REQUIRE_NO_THROW(tlvLsa.wireDecode(block));
-
-    checkTlvNameLsa(tlvLsa, lsa);
-  }
-
-  void
-  checkTlvNameLsa(const tlv::NameLsa& tlvLsa, NameLsa& lsa)
-  {
-    checkTlvLsaInfo(tlvLsa.getLsaInfo(), lsa);
-
-    std::list<ndn::Name>::const_iterator it = tlvLsa.getNames().begin();
-
-    for (const ndn::Name& name : lsa.getNpl().getNames()) {
-      BOOST_CHECK_EQUAL(*it, name);
-      ++it;
-    }
-  }
-
 public:
   ndn::util::DummyClientFace face;
   ConfParameter conf;
diff --git a/tests/publisher/test-dataset-interest-handler.cpp b/tests/publisher/test-dataset-interest-handler.cpp
index b25576f..7342f62 100644
--- a/tests/publisher/test-dataset-interest-handler.cpp
+++ b/tests/publisher/test-dataset-interest-handler.cpp
@@ -56,7 +56,7 @@
 
   // Install adjacency LSA
   AdjLsa adjLsa;
-  adjLsa.setOrigRouter("/RouterA");
+  adjLsa.m_originRouter = "/RouterA";
   addAdjacency(adjLsa, "/RouterA/adjacency1", "udp://face-1", 10);
   lsdb.installAdjLsa(adjLsa);
 
@@ -68,7 +68,7 @@
 
   // Install Name LSA
   NameLsa nameLsa;
-  nameLsa.setOrigRouter("/RouterA");
+  nameLsa.m_originRouter = "/RouterA";
   nameLsa.addName("/RouterA/name1");
   lsdb.installNameLsa(nameLsa);
 
@@ -113,7 +113,7 @@
 
   // Install adjacencies LSA
   AdjLsa adjLsa;
-  adjLsa.setOrigRouter("/RouterA");
+  adjLsa.m_originRouter = "/RouterA";
   addAdjacency(adjLsa, "/RouterA/adjacency1", "udp://face-1", 10);
   lsdb.installAdjLsa(adjLsa);
 
diff --git a/tests/security/test-certificate-store.cpp b/tests/security/test-certificate-store.cpp
index b09bd5a..0009c17 100644
--- a/tests/security/test-certificate-store.cpp
+++ b/tests/security/test-certificate-store.cpp
@@ -174,7 +174,7 @@
   lsaInterestName.append(conf.getLsaPrefix().getSubName(1));
   lsaInterestName.append(conf.getSiteName());
   lsaInterestName.append(conf.getRouterName());
-  lsaInterestName.append(std::to_string(Lsa::Type::NAME));
+  lsaInterestName.append(boost::lexical_cast<std::string>(Lsa::Type::NAME));
   lsaInterestName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq() + 1);
 
   lsdb.expressInterest(lsaInterestName, 0);
@@ -188,8 +188,8 @@
 
   ndn::Data data(lsaDataName);
   data.setFreshnessPeriod(ndn::time::seconds(10));
-  ndn::Data dummyData;
-  data.setContent(dummyData.getContent());
+  NameLsa nameLsa;
+  data.setContent(nameLsa.wireEncode());
   data.setFinalBlock(lsaDataName[-1]);
 
   // Sign data with this NLSR's key (in real it would be different NLSR)
@@ -200,10 +200,10 @@
 
   // Make NLSR validate data signed by its own key
   conf.getValidator().validate(data,
-                               [] (const ndn::Data&) { BOOST_CHECK(true); },
-                               [] (const ndn::Data&, const ndn::security::v2::ValidationError&) {
-                                 BOOST_CHECK(false);
-                               });
+                                 [] (const ndn::Data&) { BOOST_CHECK(true); },
+                                 [] (const ndn::Data&, const ndn::security::v2::ValidationError&) {
+                                   BOOST_CHECK(false);
+                                 });
 
   lsdb.emitSegmentValidatedSignal(data);
   const auto keyName = data.getSignature().getKeyLocator().getName();
diff --git a/tests/test-adjacent.cpp b/tests/test-adjacent.cpp
index a65ef97..3d61a3a 100644
--- a/tests/test-adjacent.cpp
+++ b/tests/test-adjacent.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
diff --git a/tests/test-hyperbolic-calculator.cpp b/tests/test-hyperbolic-calculator.cpp
index 0011ce9..2a787ba 100644
--- a/tests/test-hyperbolic-calculator.cpp
+++ b/tests/test-hyperbolic-calculator.cpp
@@ -24,7 +24,7 @@
 #include "route/routing-table-calculator.hpp"
 
 #include "adjacency-list.hpp"
-#include "lsa.hpp"
+//#include "lsa.hpp"
 #include "lsdb.hpp"
 #include "nlsr.hpp"
 #include "route/map.hpp"
@@ -68,7 +68,7 @@
     lsdb.installAdjLsa(adjA);
 
 
-    CoordinateLsa coordA(adjA.getOrigRouter(), 1, MAX_TIME, 16.23, anglesA);
+    CoordinateLsa coordA(adjA.getOriginRouter(), 1, MAX_TIME, 16.23, anglesA);
     lsdb.installCoordinateLsa(coordA);
 
     // Router B
@@ -82,7 +82,7 @@
     AdjLsa adjB(b.getName(), 1, MAX_TIME, 2, adjacencyListB);
     lsdb.installAdjLsa(adjB);
 
-    CoordinateLsa coordB(adjB.getOrigRouter(), 1, MAX_TIME, 16.59, anglesB);
+    CoordinateLsa coordB(adjB.getOriginRouter(), 1, MAX_TIME, 16.59, anglesB);
     lsdb.installCoordinateLsa(coordB);
 
     // Router C
@@ -96,7 +96,7 @@
     AdjLsa adjC(c.getName(), 1, MAX_TIME, 2, adjacencyListC);
     lsdb.installAdjLsa(adjC);
 
-    CoordinateLsa coordC(adjC.getOrigRouter(), 1, MAX_TIME, 14.11, anglesC);
+    CoordinateLsa coordC(adjC.getOriginRouter(), 1, MAX_TIME, 14.11, anglesC);
     lsdb.installCoordinateLsa(coordC);
 
     map.createFromAdjLsdb(lsdb.getAdjLsdb().begin(), lsdb.getAdjLsdb().end());
diff --git a/tests/test-link-state-calculator.cpp b/tests/test-link-state-calculator.cpp
index 2d8ee1b..f43c4f6 100644
--- a/tests/test-link-state-calculator.cpp
+++ b/tests/test-link-state-calculator.cpp
@@ -22,7 +22,7 @@
 #include "route/routing-table-calculator.hpp"
 
 #include "adjacency-list.hpp"
-#include "lsa.hpp"
+//#include "lsa.hpp"
 #include "lsdb.hpp"
 #include "nlsr.hpp"
 #include "test-common.hpp"
@@ -172,11 +172,11 @@
 BOOST_AUTO_TEST_CASE(Asymmetric)
 {
   // Asymmetric link cost between B and C
-  ndn::Name key = ndn::Name(ROUTER_B_NAME).append(std::to_string(Lsa::Type::ADJACENCY));
+  ndn::Name key = ndn::Name(ROUTER_B_NAME).append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY));
   AdjLsa* lsa = nlsr.m_lsdb.findAdjLsa(key);
   BOOST_REQUIRE(lsa != nullptr);
 
-  auto c = lsa->getAdl().findAdjacent(ROUTER_C_NAME);
+  auto c = lsa->m_adl.findAdjacent(ROUTER_C_NAME);
   BOOST_REQUIRE(c != conf.getAdjacencyList().end());
 
   double higherLinkCost = LINK_BC_COST + 1;
@@ -221,11 +221,11 @@
 BOOST_AUTO_TEST_CASE(NonAdjacentCost)
 {
   // Asymmetric link cost between B and C
-  ndn::Name key = ndn::Name(ROUTER_B_NAME).append(std::to_string(Lsa::Type::ADJACENCY));
+  ndn::Name key = ndn::Name(ROUTER_B_NAME).append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY));
   auto lsa = nlsr.m_lsdb.findAdjLsa(key);
   BOOST_REQUIRE(lsa != nullptr);
 
-  auto c = lsa->getAdl().findAdjacent(ROUTER_C_NAME);
+  auto c = lsa->m_adl.findAdjacent(ROUTER_C_NAME);
   BOOST_REQUIRE(c != conf.getAdjacencyList().end());
 
   // Break the link between B - C by setting it to a NON_ADJACENT_COST.
@@ -263,24 +263,24 @@
 BOOST_AUTO_TEST_CASE(AsymmetricZeroCostLink)
 {
   // Asymmetric and zero link cost between B - C, and B - A.
-  ndn::Name keyB = ndn::Name(ROUTER_B_NAME).append(std::to_string(Lsa::Type::ADJACENCY));
+  ndn::Name keyB = ndn::Name(ROUTER_B_NAME).append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY));
   auto lsaB = nlsr.m_lsdb.findAdjLsa(keyB);
   BOOST_REQUIRE(lsaB != nullptr);
 
-  auto c = lsaB->getAdl().findAdjacent(ROUTER_C_NAME);
+  auto c = lsaB->m_adl.findAdjacent(ROUTER_C_NAME);
   BOOST_REQUIRE(c != conf.getAdjacencyList().end());
   // Re-adjust link cost to 0 from B-C. However, this should not set B-C cost 0 because C-B
   // cost is greater that 0 i.e. 17
   c->setLinkCost(0);
 
-  auto a = lsaB->getAdl().findAdjacent(ROUTER_A_NAME);
+  auto a = lsaB->m_adl.findAdjacent(ROUTER_A_NAME);
   BOOST_REQUIRE(a != conf.getAdjacencyList().end());
 
-  ndn::Name keyA = ndn::Name(ROUTER_A_NAME).append(std::to_string(Lsa::Type::ADJACENCY));
+  ndn::Name keyA = ndn::Name(ROUTER_A_NAME).append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY));
   auto lsaA = nlsr.m_lsdb.findAdjLsa(keyA);
   BOOST_REQUIRE(lsaA != nullptr);
 
-  auto b = lsaA->getAdl().findAdjacent(ROUTER_B_NAME);
+  auto b = lsaA->m_adl.findAdjacent(ROUTER_B_NAME);
   BOOST_REQUIRE(b != conf.getAdjacencyList().end());
 
   // Re-adjust link cost to 0 from both the direction i.e B-A and A-B
diff --git a/tests/test-lsa-rule.cpp b/tests/test-lsa-rule.cpp
index dffe174..00c0ded 100644
--- a/tests/test-lsa-rule.cpp
+++ b/tests/test-lsa-rule.cpp
@@ -119,7 +119,7 @@
   lsaDataName.append(confParam.getRouterName());
 
   // Append LSA type
-  lsaDataName.append(std::to_string(Lsa::Type::NAME));
+  lsaDataName.append(boost::lexical_cast<std::string>(Lsa::Type::NAME));
 
   // This would be the sequence number of its own NameLsa
   lsaDataName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
@@ -149,7 +149,7 @@
   lsaDataName.append(confParam.getRouterName());
 
   // Append LSA type
-  lsaDataName.append(std::to_string(Lsa::Type::NAME));
+  lsaDataName.append(boost::lexical_cast<std::string>(Lsa::Type::NAME));
 
   // This would be the sequence number of its own NameLsa
   lsaDataName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
diff --git a/tests/test-lsa-segment-storage.cpp b/tests/test-lsa-segment-storage.cpp
index 2881d88..7862e45 100644
--- a/tests/test-lsa-segment-storage.cpp
+++ b/tests/test-lsa-segment-storage.cpp
@@ -26,7 +26,7 @@
 #include "test-common.hpp"
 #include "nlsr.hpp"
 #include "name-prefix-list.hpp"
-#include "lsa.hpp"
+// #include "lsa.hpp"
 
 namespace nlsr {
 namespace test {
@@ -68,9 +68,9 @@
       npl1.insert("name1-" + std::to_string(i));
     }
     NameLsa nameLsa("/ndn/other-site/%C1.Router/other-router", 12,
-                    ndn::time::system_clock::now() + ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT), npl1);
-    segmentPublisher.publish(interestName, interestName,
-                             ndn::encoding::makeStringBlock(ndn::tlv::Content, nameLsa.serialize()),
+                    ndn::time::system_clock::now() + ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT),
+                    npl1);
+    segmentPublisher.publish(interestName, interestName, nameLsa.wireEncode(),
                              ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT));
   }
 
diff --git a/tests/test-lsa.cpp b/tests/test-lsa.cpp
index 20fc1c1..fb08473 100644
--- a/tests/test-lsa.cpp
+++ b/tests/test-lsa.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2017,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -19,43 +19,162 @@
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  **/
 
-#include "lsa.hpp"
+#include "lsa/name-lsa.hpp"
+#include "lsa/adj-lsa.hpp"
+#include "lsa/coordinate-lsa.hpp"
 #include "test-common.hpp"
 #include "adjacent.hpp"
 #include "name-prefix-list.hpp"
 
 #include <ndn-cxx/util/time.hpp>
-#include <sstream>
 
 namespace nlsr {
 namespace test {
 
+/*static void
+printBytes(const uint8_t* buf, size_t size)
+{
+  std::string hex = ndn::toHex(buf, size);
+
+  for (size_t i = 0; i < hex.size(); i++) {
+    if (i > 0 && i % 30 == 0)
+      std::cout << "\n  ";
+
+    std::cout << "0x" << hex[i];
+    std::cout << hex[++i];
+
+    if ((i + 1) != hex.size())
+      std::cout << ", ";
+  }
+  std::cout << "\n" << "};" << std::endl;
+}
+
+printBytes(wire.wire(), wire.size());*/
+
 BOOST_AUTO_TEST_SUITE(TestLsa)
 
+const uint8_t NAME_LSA1[] = {
+  0x89, 0x37, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0C, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x33, 0x34, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61,
+  0x6D, 0x65, 0x31, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61, 0x6D, 0x65, 0x32
+};
+
+const uint8_t NAME_LSA_EXTRA_NAME[] = {
+  0x89, 0x40, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0C, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x33, 0x34, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61,
+  0x6D, 0x65, 0x31, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61, 0x6D, 0x65, 0x32, 0x07, 0x07, 0x08,
+  0x05, 0x6E, 0x61, 0x6D, 0x65, 0x33
+};
+
+const uint8_t NAME_LSA_DIFF_SEQ[] = {
+  0x89, 0x40, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0E, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x33, 0x34, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61,
+  0x6D, 0x65, 0x31, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61, 0x6D, 0x65, 0x32, 0x07, 0x07, 0x08,
+  0x05, 0x6E, 0x61, 0x6D, 0x65, 0x33
+};
+
+const uint8_t NAME_LSA_DIFF_TS[] = {
+  0x89, 0x40, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0E, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x34, 0x34, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61,
+  0x6D, 0x65, 0x31, 0x07, 0x07, 0x08, 0x05, 0x6E, 0x61, 0x6D, 0x65, 0x32, 0x07, 0x07, 0x08,
+  0x05, 0x6E, 0x61, 0x6D, 0x65, 0x33
+};
+
 BOOST_AUTO_TEST_CASE(NameLsaBasic)
 {
   ndn::Name s1{"name1"};
   ndn::Name s2{"name2"};
   NamePrefixList npl1{s1, s2};
 
-  ndn::time::system_clock::TimePoint testTimePoint =  ndn::time::system_clock::now();
+  ndn::time::system_clock::TimePoint testTimePoint =
+    ndn::time::fromUnixTimestamp(ndn::time::milliseconds(1585196014943));
 
-  //3rd arg is seqNo. which will be a random number I just put in 12.
+  // 3rd argument is seqNo
   NameLsa nlsa1("router1", 12, testTimePoint, npl1);
   NameLsa nlsa2("router2", 12, testTimePoint, npl1);
 
   BOOST_CHECK_EQUAL(nlsa1.getType(), Lsa::Type::NAME);
-
   BOOST_CHECK(nlsa1.getExpirationTimePoint() == nlsa2.getExpirationTimePoint());
-
   BOOST_CHECK(nlsa1.getKey() != nlsa2.getKey());
+
+  auto wire = nlsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(NAME_LSA1, NAME_LSA1 + sizeof(NAME_LSA1),
+                                wire.begin(), wire.end());
+
+  nlsa1.addName("name3");
+  wire = nlsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(NAME_LSA_EXTRA_NAME,
+                                NAME_LSA_EXTRA_NAME + sizeof(NAME_LSA_EXTRA_NAME),
+                                wire.begin(), wire.end());
+
+  nlsa1.setSeqNo(14);
+  wire = nlsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(NAME_LSA_DIFF_SEQ, NAME_LSA_DIFF_SEQ + sizeof(NAME_LSA_DIFF_SEQ),
+                                wire.begin(), wire.end());
+
+  testTimePoint =
+    ndn::time::fromUnixTimestamp(ndn::time::milliseconds(1585196024993));
+  nlsa1.setExpirationTimePoint(testTimePoint);
+  wire = nlsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(NAME_LSA_DIFF_TS, NAME_LSA_DIFF_TS + sizeof(NAME_LSA_DIFF_TS),
+                                wire.begin(), wire.end());
+  // Not testing router name as not sure if that will ever change once set
 }
 
-BOOST_AUTO_TEST_CASE(AdjacentLsaConstructorAndGetters)
+const uint8_t ADJ_LSA1[] = {
+  0x83, 0x58, 0x80, 0x2D, 0x07, 0x13, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04, 0x73, 0x69,
+  0x74, 0x65, 0x08, 0x06, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x82, 0x01, 0x0C, 0x8B, 0x13,
+  0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36, 0x20, 0x30, 0x34, 0x3A, 0x31,
+  0x33, 0x3A, 0x33, 0x34, 0x84, 0x27, 0x07, 0x16, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04,
+  0x73, 0x69, 0x74, 0x65, 0x08, 0x09, 0x61, 0x64, 0x6A, 0x61, 0x63, 0x65, 0x6E, 0x63, 0x79,
+  0x8D, 0x03, 0x3A, 0x2F, 0x2F, 0x8C, 0x08, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const uint8_t ADJ_LSA_EXTRA_NEIGHBOR[] = {
+  0x83, 0x80, 0x80, 0x2D, 0x07, 0x13, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04, 0x73, 0x69,
+  0x74, 0x65, 0x08, 0x06, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x82, 0x01, 0x0C, 0x8B, 0x13,
+  0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36, 0x20, 0x30, 0x34, 0x3A, 0x31,
+  0x33, 0x3A, 0x33, 0x34, 0x84, 0x27, 0x07, 0x16, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04,
+  0x73, 0x69, 0x74, 0x65, 0x08, 0x09, 0x61, 0x64, 0x6A, 0x61, 0x63, 0x65, 0x6E, 0x63, 0x79,
+  0x8D, 0x03, 0x3A, 0x2F, 0x2F, 0x8C, 0x08, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x84, 0x26, 0x07, 0x15, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x03, 0x65, 0x64, 0x75, 0x08,
+  0x09, 0x61, 0x64, 0x6A, 0x61, 0x63, 0x65, 0x6E, 0x63, 0x79, 0x8D, 0x03, 0x3A, 0x2F, 0x2F,
+  0x8C, 0x08, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const uint8_t ADJ_LSA_DIFF_SEQ[] = {
+  0x83, 0x80, 0x80, 0x2D, 0x07, 0x13, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04, 0x73, 0x69,
+  0x74, 0x65, 0x08, 0x06, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x82, 0x01, 0x0E, 0x8B, 0x13,
+  0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36, 0x20, 0x30, 0x34, 0x3A, 0x31,
+  0x33, 0x3A, 0x33, 0x34, 0x84, 0x27, 0x07, 0x16, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04,
+  0x73, 0x69, 0x74, 0x65, 0x08, 0x09, 0x61, 0x64, 0x6A, 0x61, 0x63, 0x65, 0x6E, 0x63, 0x79,
+  0x8D, 0x03, 0x3A, 0x2F, 0x2F, 0x8C, 0x08, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x84, 0x26, 0x07, 0x15, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x03, 0x65, 0x64, 0x75, 0x08,
+  0x09, 0x61, 0x64, 0x6A, 0x61, 0x63, 0x65, 0x6E, 0x63, 0x79, 0x8D, 0x03, 0x3A, 0x2F, 0x2F,
+  0x8C, 0x08, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+const uint8_t ADJ_LSA_DIFF_TS[] = {
+  0x83, 0x80, 0x80, 0x2D, 0x07, 0x13, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04, 0x73, 0x69,
+  0x74, 0x65, 0x08, 0x06, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x82, 0x01, 0x0E, 0x8B, 0x13,
+  0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36, 0x20, 0x30, 0x34, 0x3A, 0x31,
+  0x33, 0x3A, 0x34, 0x34, 0x84, 0x27, 0x07, 0x16, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x04,
+  0x73, 0x69, 0x74, 0x65, 0x08, 0x09, 0x61, 0x64, 0x6A, 0x61, 0x63, 0x65, 0x6E, 0x63, 0x79,
+  0x8D, 0x03, 0x3A, 0x2F, 0x2F, 0x8C, 0x08, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x84, 0x26, 0x07, 0x15, 0x08, 0x03, 0x6E, 0x64, 0x6E, 0x08, 0x03, 0x65, 0x64, 0x75, 0x08,
+  0x09, 0x61, 0x64, 0x6A, 0x61, 0x63, 0x65, 0x6E, 0x63, 0x79, 0x8D, 0x03, 0x3A, 0x2F, 0x2F,
+  0x8C, 0x08, 0x40, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+BOOST_AUTO_TEST_CASE(AdjLsaBasic)
 {
   ndn::Name routerName("/ndn/site/router");
   ndn::Name adjacencyName("/ndn/site/adjacency");
-  ndn::time::system_clock::TimePoint testTimePoint =  ndn::time::system_clock::now();
+  ndn::time::system_clock::TimePoint testTimePoint =
+    ndn::time::fromUnixTimestamp(ndn::time::milliseconds(1585196014943));
   uint32_t seqNo = 12;
 
   // An AdjLsa initialized with ACTIVE adjacencies should copy the adjacencies
@@ -68,7 +187,7 @@
                activeAdjacencies.size(), activeAdjacencies);
   BOOST_CHECK_EQUAL(alsa1.getAdl().size(), 1);
   BOOST_CHECK_EQUAL(alsa1.getType(), Lsa::Type::ADJACENCY);
-  BOOST_CHECK_EQUAL(alsa1.getLsSeqNo(), seqNo);
+  BOOST_CHECK_EQUAL(alsa1.getSeqNo(), seqNo);
   BOOST_CHECK_EQUAL(alsa1.getExpirationTimePoint(), testTimePoint);
   BOOST_CHECK_EQUAL(alsa1.getNoLink(), 1);
   BOOST_CHECK(alsa1.getAdl().isNeighbor(activeAdjacency.getName()));
@@ -90,12 +209,73 @@
   AdjLsa alsa3(routerName, seqNo, testTimePoint,
                activeAdjacencies.size(), activeAdjacencies);
   BOOST_CHECK(alsa1.isEqualContent(alsa3));
+
+  auto wire = alsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(ADJ_LSA1, ADJ_LSA1 + sizeof(ADJ_LSA1),
+                                wire.begin(), wire.end());
+
+  Adjacent activeAdjacency2("/ndn/edu/adjacency");
+  activeAdjacency2.setStatus(Adjacent::STATUS_ACTIVE);
+  alsa1.addAdjacent(activeAdjacency2);
+  wire = alsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(ADJ_LSA_EXTRA_NEIGHBOR,
+                                ADJ_LSA_EXTRA_NEIGHBOR + sizeof(ADJ_LSA_EXTRA_NEIGHBOR),
+                                wire.begin(), wire.end());
+
+  alsa1.setSeqNo(14);
+  wire = alsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(ADJ_LSA_DIFF_SEQ, ADJ_LSA_DIFF_SEQ + sizeof(ADJ_LSA_DIFF_SEQ),
+                                wire.begin(), wire.end());
+
+  testTimePoint =
+    ndn::time::fromUnixTimestamp(ndn::time::milliseconds(1585196024993));
+  alsa1.setExpirationTimePoint(testTimePoint);
+  wire = alsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(ADJ_LSA_DIFF_TS, ADJ_LSA_DIFF_TS + sizeof(ADJ_LSA_DIFF_TS),
+                                wire.begin(), wire.end());
 }
 
-BOOST_AUTO_TEST_CASE(CoordinateLsaConstructorAndGetters)
+const uint8_t COORDINATE_LSA1[] = {
+  0x85, 0x43, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0C, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x33, 0x34, 0x87, 0x08, 0x40, 0x04, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x88, 0x08, 0x40, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88,
+  0x08, 0x40, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const uint8_t COORDINATE_LSA_DIFF_ANGLE[] = {
+  0x85, 0x39, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0C, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x33, 0x34, 0x87, 0x08, 0x40, 0x04, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x88, 0x08, 0x40, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const uint8_t COORDINATE_LSA_DIFF_RADIUS[] = {
+  0x85, 0x39, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0C, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x33, 0x34, 0x87, 0x08, 0x40, 0x02, 0x66, 0x66,
+  0x66, 0x66, 0x66, 0x66, 0x88, 0x08, 0x40, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const uint8_t COORDINATE_LSA_DIFF_SEQ[] = {
+  0x85, 0x39, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0E, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x33, 0x34, 0x87, 0x08, 0x40, 0x02, 0x66, 0x66,
+  0x66, 0x66, 0x66, 0x66, 0x88, 0x08, 0x40, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+const uint8_t COORDINATE_LSA_DIFF_TS[] = {
+  0x85, 0x39, 0x80, 0x23, 0x07, 0x09, 0x08, 0x07, 0x72, 0x6F, 0x75, 0x74, 0x65, 0x72, 0x31,
+  0x82, 0x01, 0x0E, 0x8B, 0x13, 0x32, 0x30, 0x32, 0x30, 0x2D, 0x30, 0x33, 0x2D, 0x32, 0x36,
+  0x20, 0x30, 0x34, 0x3A, 0x31, 0x33, 0x3A, 0x34, 0x34, 0x87, 0x08, 0x40, 0x02, 0x66, 0x66,
+  0x66, 0x66, 0x66, 0x66, 0x88, 0x08, 0x40, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+BOOST_AUTO_TEST_CASE(CoordinateLsaBasic)
 {
-  ndn::time::system_clock::TimePoint testTimePoint =  ndn::time::system_clock::now();
-  std::vector<double> angles1, angles2;
+  ndn::time::system_clock::TimePoint testTimePoint =
+    ndn::time::fromUnixTimestamp(ndn::time::milliseconds(1585196014943));
+  std::vector<double> angles1 {30.0}, angles2 {30.0};
   angles1.push_back(30.0);
   angles2.push_back(30.0);
   CoordinateLsa clsa1("router1", 12, testTimePoint, 2.5, angles1);
@@ -106,7 +286,38 @@
 
   BOOST_CHECK(clsa1.isEqualContent(clsa2));
 
-  BOOST_CHECK_EQUAL(clsa1.serialize(), clsa2.serialize());
+  BOOST_CHECK_EQUAL(clsa1.wireEncode(), clsa2.wireEncode());
+
+  auto wire = clsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(COORDINATE_LSA1, COORDINATE_LSA1 + sizeof(COORDINATE_LSA1),
+                                wire.begin(), wire.end());
+
+  std::vector<double> angles3{40.0};
+  clsa1.setCorTheta(angles3);
+  wire = clsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(COORDINATE_LSA_DIFF_ANGLE,
+                                COORDINATE_LSA_DIFF_ANGLE + sizeof(COORDINATE_LSA_DIFF_ANGLE),
+                                wire.begin(), wire.end());
+
+  clsa1.setCorRadius(2.3);
+  wire = clsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(COORDINATE_LSA_DIFF_RADIUS,
+                                COORDINATE_LSA_DIFF_RADIUS + sizeof(COORDINATE_LSA_DIFF_RADIUS),
+                                wire.begin(), wire.end());
+
+  clsa1.setSeqNo(14);
+  wire = clsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(COORDINATE_LSA_DIFF_SEQ,
+                                COORDINATE_LSA_DIFF_SEQ + sizeof(COORDINATE_LSA_DIFF_SEQ),
+                                wire.begin(), wire.end());
+
+  testTimePoint =
+    ndn::time::fromUnixTimestamp(ndn::time::milliseconds(1585196024993));
+  clsa1.setExpirationTimePoint(testTimePoint);
+  wire = clsa1.wireEncode();
+  BOOST_CHECK_EQUAL_COLLECTIONS(COORDINATE_LSA_DIFF_TS,
+                                COORDINATE_LSA_DIFF_TS + sizeof(COORDINATE_LSA_DIFF_TS),
+                                wire.begin(), wire.end());
 }
 
 BOOST_AUTO_TEST_CASE(IncrementAdjacentNumber)
@@ -121,7 +332,7 @@
   adjList.insert(adj1);
   adjList.insert(adj2);
 
-  ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now();
+  ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now() + ndn::time::seconds(3600);
   std::ostringstream ss;
   ss << testTimePoint;
 
@@ -130,19 +341,13 @@
   AdjLsa lsa("router1", 12, testTimePoint, adjList.size(), adjList);
 
   std::string EXPECTED_OUTPUT =
-    "LSA of type ADJACENCY:\n"
-    "-Origin Router: /router1\n"
-    "-Sequence Number: 12\n"
-    "-Expiration Point: " + TEST_TIME_POINT_STRING + "\n"
-    "-Adjacents:--Adjacent1:\n"
-    "---Adjacent Name: /adjacent1\n"
-    "---Connecting FaceUri: ://\n"
-    "---Link Cost: 10\n"
-    "--Adjacent2:\n"
-    "---Adjacent Name: /adjacent2\n"
-    "---Connecting FaceUri: ://\n"
-    "---Link Cost: 10\n"
-    "adj_lsa_end";
+    "    ADJACENCY LSA:\n"
+    "      Origin Router      : /router1\n"
+    "      Sequence Number    : 12\n"
+    "      Expires in         : 3599999 milliseconds\n"
+    "      Adjacents:\n"
+    "        Adjacent 0: (name=/adjacent1, uri=://, cost=10)\n"
+    "        Adjacent 1: (name=/adjacent2, uri=://, cost=10)\n";
 
   std::ostringstream os;
   os << lsa;
@@ -172,10 +377,7 @@
   ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now();
 
   AdjLsa adjlsa1("router1", 1, testTimePoint, adjList.size(), adjList);
-  AdjLsa adjlsa2;
-
-  BOOST_CHECK(adjlsa2.deserialize(adjlsa1.serialize()));
-
+  AdjLsa adjlsa2(adjlsa1.wireEncode());
   BOOST_CHECK(adjlsa1.isEqualContent(adjlsa2));
 
   //Name LSA
@@ -184,24 +386,16 @@
   NamePrefixList npl1{s1, s2};
 
   NameLsa nlsa1("router1", 1, testTimePoint, npl1);
-  NameLsa nlsa2;
-
-  BOOST_CHECK(nlsa2.deserialize(nlsa1.serialize()));
-
-  BOOST_CHECK_EQUAL(nlsa1.serialize(), nlsa2.serialize());
+  NameLsa nlsa2(nlsa1.wireEncode());
+  BOOST_CHECK_EQUAL(nlsa1.wireEncode(), nlsa2.wireEncode());
 
   //Coordinate LSA
   std::vector<double> angles = {30, 40.0};
   CoordinateLsa clsa1("router1", 12, testTimePoint, 2.5, angles);
-  CoordinateLsa clsa2;
-
-  BOOST_CHECK(clsa2.deserialize(clsa1.serialize()));
-
-  BOOST_CHECK_EQUAL(clsa1.serialize(), clsa2.serialize());
+  CoordinateLsa clsa2(clsa1.wireEncode());
+  BOOST_CHECK_EQUAL(clsa1.wireEncode(), clsa2.wireEncode());
 }
 
-BOOST_AUTO_TEST_SUITE(TestNameLsa)
-
 BOOST_AUTO_TEST_CASE(OperatorEquals)
 {
   NameLsa lsa1;
@@ -221,8 +415,6 @@
   BOOST_CHECK(lsa1.isEqualContent(lsa2));
 }
 
-BOOST_AUTO_TEST_SUITE_END() // TestNameLsa
-
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace test
diff --git a/tests/test-lsdb.cpp b/tests/test-lsdb.cpp
index 56e862b..9ed1f26 100644
--- a/tests/test-lsdb.cpp
+++ b/tests/test-lsdb.cpp
@@ -23,7 +23,7 @@
 
 #include "test-common.hpp"
 #include "nlsr.hpp"
-#include "lsa.hpp"
+#include "lsa/lsa.hpp"
 #include "name-prefix-list.hpp"
 
 #include <ndn-cxx/util/dummy-client-face.hpp>
@@ -175,12 +175,13 @@
   ndn::Name lsaKey("/ndn/site/%C1.Router/this-router/NAME");
 
   NameLsa* nameLsa = lsdb.findNameLsa(lsaKey);
-  uint64_t seqNo = nameLsa->getLsSeqNo();
+  BOOST_REQUIRE(nameLsa != nullptr);
+  uint64_t seqNo = nameLsa->getSeqNo();
 
   ndn::Name prefix("/ndn/edu/memphis/netlab/research/nlsr/test/prefix/");
 
   int nPrefixes = 0;
-  while (nameLsa->serialize().size() < ndn::MAX_NDN_PACKET_SIZE) {
+  while (nameLsa->wireEncode().size() < ndn::MAX_NDN_PACKET_SIZE) {
     nameLsa->addName(ndn::Name(prefix).appendNumber(++nPrefixes));
     break;
   }
@@ -218,17 +219,17 @@
   ndn::Name lsaKey("/ndn/site/%C1.Router/this-router/NAME");
 
   NameLsa* lsa = lsdb.findNameLsa(lsaKey);
-  uint64_t seqNo = lsa->getLsSeqNo();
+  uint64_t seqNo = lsa->getSeqNo();
 
   ndn::Name prefix("/ndn/edu/memphis/netlab/research/nlsr/test/prefix/");
 
   int nPrefixes = 0;
-  while (lsa->serialize().size() < ndn::MAX_NDN_PACKET_SIZE) {
+  while (lsa->wireEncode().size() < ndn::MAX_NDN_PACKET_SIZE) {
     lsa->addName(ndn::Name(prefix).appendNumber(++nPrefixes));
   }
   lsdb.installNameLsa(*lsa);
 
-  std::string expectedDataContent = lsa->serialize();
+  ndn::Block expectedDataContent = lsa->wireEncode();
 
   ndn::Name interestName("/localhop/ndn/nlsr/LSA/site/%C1.Router/this-router/NAME/");
   interestName.appendNumber(seqNo);
@@ -240,7 +241,7 @@
                                                   ndn::security::v2::getAcceptAllValidator());
   fetcher->onComplete.connect([&expectedDataContent] (ndn::ConstBufferPtr bufferPtr) {
                                 ndn::Block block(bufferPtr);
-                                BOOST_CHECK_EQUAL(expectedDataContent, readString(block));
+                                BOOST_CHECK_EQUAL(expectedDataContent, block);
                               });
 
   advanceClocks(ndn::time::milliseconds(1), 100);
@@ -264,13 +265,13 @@
   ndn::Name interestName("/localhop/ndn/nlsr/LSA/cs/%C1.Router/router1/NAME/");
   interestName.appendNumber(seqNo);
 
-  ndn::Block block = ndn::encoding::makeStringBlock(ndn::tlv::Content, lsa.serialize());
+  ndn::Block block = lsa.wireEncode();
   lsdb.afterFetchLsa(block.getBuffer(), interestName);
 
   NameLsa* foundLsa = lsdb.findNameLsa(lsa.getKey());
   BOOST_REQUIRE(foundLsa != nullptr);
 
-  BOOST_CHECK_EQUAL(foundLsa->serialize(), lsa.serialize());
+  BOOST_CHECK_EQUAL(foundLsa->wireEncode(), lsa.wireEncode());
 }
 
 BOOST_AUTO_TEST_CASE(LsdbRemoveAndExists)
diff --git a/tests/test-name-prefix-list.cpp b/tests/test-name-prefix-list.cpp
index 3bb93b7..687d6c3 100644
--- a/tests/test-name-prefix-list.cpp
+++ b/tests/test-name-prefix-list.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp
index ab69692..ab5fd15 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.cpp
@@ -142,7 +142,7 @@
   Adjacent neighbor("/ndn/neighborA", ndn::FaceUri(faceUri), 10,
                     Adjacent::STATUS_INACTIVE, 0, 0);
 
-  BOOST_REQUIRE_EQUAL(conf.getAdjacencyList().insert(neighbor), 0);
+  BOOST_REQUIRE_EQUAL(conf.getAdjacencyList().insert(neighbor), true);
 
   this->advanceClocks(10_ms);
 
@@ -306,11 +306,11 @@
 
   // Make sure an adjacency LSA was built
   ndn::Name key = ndn::Name(conf.getRouterPrefix())
-    .append(std::to_string(Lsa::Type::ADJACENCY));
+    .append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY));
   AdjLsa* lsa = lsdb.findAdjLsa(key);
   BOOST_REQUIRE(lsa != nullptr);
 
-  uint32_t lastAdjLsaSeqNo = lsa->getLsSeqNo();
+  uint32_t lastAdjLsaSeqNo = lsa->getSeqNo();
   nlsr.m_lsdb.m_sequencingManager.setAdjLsaSeq(lastAdjLsaSeqNo);
 
   this->advanceClocks(1500_ms, 10);
@@ -345,7 +345,7 @@
   lsa = lsdb.findAdjLsa(key);
   BOOST_REQUIRE(lsa != nullptr);
 
-  BOOST_CHECK_EQUAL(lsa->getLsSeqNo(), lastAdjLsaSeqNo + 1);
+  BOOST_CHECK_EQUAL(lsa->getSeqNo(), lastAdjLsaSeqNo + 1);
 
   this->advanceClocks(15_s, 10);
 
@@ -381,7 +381,7 @@
   receiveHelloData(neighborAName, conf.getRouterPrefix());
   this->advanceClocks(1_s, 10);
 
-  ndn::Name lsaKey = ndn::Name(conf.getRouterPrefix()).append(std::to_string(Lsa::Type::ADJACENCY));
+  ndn::Name lsaKey = ndn::Name(conf.getRouterPrefix()).append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY));
 
   // Adjacency LSA should be built even though other router is INACTIVE
   AdjLsa* lsa = lsdb.findAdjLsa(lsaKey);
diff --git a/tests/test-sequencing-manager.cpp b/tests/test-sequencing-manager.cpp
index 6bbcb00..218952a 100644
--- a/tests/test-sequencing-manager.cpp
+++ b/tests/test-sequencing-manager.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
diff --git a/tests/test-statistics.cpp b/tests/test-statistics.cpp
index 0dbe274..cfd82b6 100644
--- a/tests/test-statistics.cpp
+++ b/tests/test-statistics.cpp
@@ -198,16 +198,16 @@
   uint32_t seqNo = 1;
 
   // Adjacency LSA
-  sendInterestAndCheckStats(interestPrefix, std::to_string(Lsa::Type::ADJACENCY), seqNo,
-                            Statistics::PacketType::SENT_ADJ_LSA_INTEREST);
+  sendInterestAndCheckStats(interestPrefix, boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY),
+                            seqNo, Statistics::PacketType::SENT_ADJ_LSA_INTEREST);
 
   // Coordinate LSA
-  sendInterestAndCheckStats(interestPrefix, std::to_string(Lsa::Type::COORDINATE), seqNo,
-                            Statistics::PacketType::SENT_COORD_LSA_INTEREST);
+  sendInterestAndCheckStats(interestPrefix, boost::lexical_cast<std::string>(Lsa::Type::COORDINATE),
+                            seqNo, Statistics::PacketType::SENT_COORD_LSA_INTEREST);
 
   // Name LSA
-  sendInterestAndCheckStats(interestPrefix, std::to_string(Lsa::Type::NAME), seqNo,
-                            Statistics::PacketType::SENT_NAME_LSA_INTEREST);
+  sendInterestAndCheckStats(interestPrefix, boost::lexical_cast<std::string>(Lsa::Type::NAME),
+                            seqNo, Statistics::PacketType::SENT_NAME_LSA_INTEREST);
 
   // 3 total lsa interests were sent
   BOOST_CHECK_EQUAL(collector.getStatistics().get(Statistics::PacketType::SENT_LSA_INTEREST), 3);
@@ -226,10 +226,10 @@
   lsdb.buildAndInstallOwnAdjLsa();
 
   ndn::Name adjLsaKey = conf.getRouterPrefix();
-  adjLsaKey.append(std::to_string(Lsa::Type::ADJACENCY));
+  adjLsaKey.append(boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY));
 
   AdjLsa* adjLsa = lsdb.findAdjLsa(adjLsaKey);
-  uint32_t seqNo = adjLsa->getLsSeqNo();
+  uint32_t seqNo = adjLsa->getSeqNo();
 
   Adjacent adjacency("adjacency");
   adjacency.setStatus(Adjacent::STATUS_ACTIVE);
@@ -242,26 +242,26 @@
 
   // Receive Adjacency LSA Interest
   receiveInterestAndCheckSentStats(interestPrefix,
-                                   std::to_string(Lsa::Type::ADJACENCY),
+                                   boost::lexical_cast<std::string>(Lsa::Type::ADJACENCY),
                                    seqNo,
                                    Statistics::PacketType::RCV_ADJ_LSA_INTEREST,
                                    Statistics::PacketType::SENT_ADJ_LSA_DATA);
 
   // Name LSA
   ndn::Name nameLsaKey = conf.getRouterPrefix();
-  nameLsaKey.append(std::to_string(Lsa::Type::NAME));
+  nameLsaKey.append(boost::lexical_cast<std::string>(Lsa::Type::NAME));
 
   NameLsa* nameLsa = lsdb.findNameLsa(nameLsaKey);
   BOOST_ASSERT(nameLsa != nullptr);
 
-  seqNo = nameLsa->getLsSeqNo();
+  seqNo = nameLsa->getSeqNo();
 
   nameLsa->addName(ndn::Name("/ndn/name"));
   lsdb.installNameLsa(*nameLsa);
 
   // Receive Name LSA Interest
   receiveInterestAndCheckSentStats(interestPrefix,
-                                   std::to_string(Lsa::Type::NAME),
+                                   boost::lexical_cast<std::string>(Lsa::Type::NAME),
                                    seqNo,
                                    Statistics::PacketType::RCV_NAME_LSA_INTEREST,
                                    Statistics::PacketType::SENT_NAME_LSA_DATA);
@@ -269,16 +269,16 @@
   // // Coordinate LSA
   lsdb.buildAndInstallOwnCoordinateLsa();
   ndn::Name coorLsaKey = conf.getRouterPrefix();
-  coorLsaKey.append(std::to_string(Lsa::Type::COORDINATE));
+  coorLsaKey.append(boost::lexical_cast<std::string>(Lsa::Type::COORDINATE));
 
   CoordinateLsa* coorLsa = lsdb.findCoordinateLsa(coorLsaKey);
-  seqNo = coorLsa->getLsSeqNo();
+  seqNo = coorLsa->getSeqNo();
   coorLsa->setCorTheta({20.0, 30.0});
   lsdb.installCoordinateLsa(*coorLsa);
 
   // Receive Adjacency LSA Interest
   receiveInterestAndCheckSentStats(interestPrefix,
-                                   std::to_string(Lsa::Type::COORDINATE),
+                                   boost::lexical_cast<std::string>(Lsa::Type::COORDINATE),
                                    seqNo,
                                    Statistics::PacketType::RCV_COORD_LSA_INTEREST,
                                    Statistics::PacketType::SENT_COORD_LSA_DATA);
@@ -306,9 +306,7 @@
   AdjLsa aLsa(routerName, seqNo, MAX_TIME, 1, conf.getAdjacencyList());
   lsdb.installAdjLsa(aLsa);
 
-  ndn::Block block = ndn::encoding::makeStringBlock(ndn::tlv::Content, aLsa.serialize());
-
-  lsdb.afterFetchLsa(block.getBuffer(), adjInterest);
+  lsdb.afterFetchLsa(aLsa.wireEncode().getBuffer(), adjInterest);
   BOOST_CHECK_EQUAL(collector.getStatistics().get(Statistics::PacketType::RCV_ADJ_LSA_DATA), 1);
 
   // coordinate lsa
@@ -318,20 +316,16 @@
   CoordinateLsa cLsa(routerName, seqNo, MAX_TIME, 2.5, angles);
   lsdb.installCoordinateLsa(cLsa);
 
-  block = ndn::encoding::makeStringBlock(ndn::tlv::Content, cLsa.serialize());
-
-  lsdb.afterFetchLsa(block.getBuffer(), coordInterest);
+  lsdb.afterFetchLsa(cLsa.wireEncode().getBuffer(), coordInterest);
   BOOST_CHECK_EQUAL(collector.getStatistics().get(Statistics::PacketType::RCV_COORD_LSA_DATA), 1);
 
   // name lsa
   ndn::Name interestName("/localhop/ndn/nlsr/LSA/cs/%C1.Router/router1/NAME/");
   interestName.appendNumber(seqNo);
-  NameLsa nLsa(routerName, seqNo, MAX_TIME, conf.getNamePrefixList());
-  lsdb.installNameLsa(nLsa);
+  NameLsa nlsa(routerName, seqNo, MAX_TIME, conf.getNamePrefixList());
+  lsdb.installNameLsa(nlsa);
 
-  block = ndn::encoding::makeStringBlock(ndn::tlv::Content, nLsa.serialize());
-
-  lsdb.afterFetchLsa(block.getBuffer(), interestName);
+  lsdb.afterFetchLsa(nlsa.wireEncode().getBuffer(), interestName);
   BOOST_CHECK_EQUAL(collector.getStatistics().get(Statistics::PacketType::RCV_NAME_LSA_DATA), 1);
 
   // 3 lsa data types should be received
diff --git a/tests/tlv/test-adjacency-lsa.cpp b/tests/tlv/test-adjacency-lsa.cpp
deleted file mode 100644
index 531e1a4..0000000
--- a/tests/tlv/test-adjacency-lsa.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "tlv/adjacency-lsa.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestAdjacencyLsa)
-
-const uint8_t AdjacencyLsaWithAdjacenciesData[] =
-{
-  // Header
-  0x83, 0x3d,
-  // LsaInfo
-  0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
-  0x80, 0x8b, 0x02, 0x27, 0x10,
-  // Adjacency
-  0x84, 0x13, 0x07, 0x07, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31, 0x8d, 0x05, 0x74,
-  0x65, 0x73, 0x74, 0x31, 0x8c, 0x01, 0x80,
-  // Adjacency
-  0x84, 0x13, 0x07, 0x07, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32, 0x8d, 0x05, 0x74,
-  0x65, 0x73, 0x74, 0x32, 0x8c, 0x01, 0x80
-};
-
-const uint8_t AdjacencyLsaWithoutAdjacenciesData[] =
-{
-  // Header
-  0x83, 0x13,
-  // LsaInfo
-  0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
-  0x80, 0x8b, 0x02, 0x27, 0x10
-};
-
-BOOST_AUTO_TEST_CASE(AdjacencyLsaEncodeWithAdjacencies)
-{
-  AdjacencyLsa adjacencyLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  adjacencyLsa.setLsaInfo(lsaInfo);
-
-  Adjacency adjacency1;
-  adjacency1.setName("test1");
-  adjacency1.setUri("test1");
-  adjacency1.setCost(128);
-  adjacencyLsa.addAdjacency(adjacency1);
-
-  Adjacency adjacency2;
-  adjacency2.setName("test2");
-  adjacency2.setUri("test2");
-  adjacency2.setCost(128);
-  adjacencyLsa.addAdjacency(adjacency2);
-
-  const ndn::Block& wire = adjacencyLsa.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(AdjacencyLsaWithAdjacenciesData,
-                                  AdjacencyLsaWithAdjacenciesData +
-                                    sizeof(AdjacencyLsaWithAdjacenciesData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyLsaDecodeWithAdjacencies)
-{
-  AdjacencyLsa adjacencyLsa;
-
-  adjacencyLsa.wireDecode(ndn::Block(AdjacencyLsaWithAdjacenciesData,
-                                      sizeof(AdjacencyLsaWithAdjacenciesData)));
-
-  LsaInfo lsaInfo = adjacencyLsa.getLsaInfo();
-  BOOST_CHECK_EQUAL(lsaInfo.getOriginRouter(), "test");
-  BOOST_CHECK_EQUAL(lsaInfo.getSequenceNumber(), 128);
-  BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
-
-  BOOST_CHECK_EQUAL(adjacencyLsa.hasAdjacencies(), true);
-  std::list<Adjacency> adjacencies = adjacencyLsa.getAdjacencies();
-  std::list<Adjacency>::const_iterator it = adjacencies.begin();
-  BOOST_CHECK_EQUAL(it->getName(), "test1");
-  BOOST_CHECK_EQUAL(it->getUri(), "test1");
-  BOOST_CHECK_EQUAL(it->getCost(), 128);
-
-  it++;
-  BOOST_CHECK_EQUAL(it->getName(), "test2");
-  BOOST_CHECK_EQUAL(it->getUri(), "test2");
-  BOOST_CHECK_EQUAL(it->getCost(), 128);
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyLsaEncodeWithoutAdjacencies)
-{
-  AdjacencyLsa adjacencyLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  adjacencyLsa.setLsaInfo(lsaInfo);
-
-  const ndn::Block& wire = adjacencyLsa.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(AdjacencyLsaWithoutAdjacenciesData,
-                                  AdjacencyLsaWithoutAdjacenciesData +
-                                    sizeof(AdjacencyLsaWithoutAdjacenciesData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyLsaDecodeWithoutAdjacencies)
-{
-  AdjacencyLsa adjacencyLsa;
-
-  adjacencyLsa.wireDecode(ndn::Block(AdjacencyLsaWithoutAdjacenciesData,
-                                      sizeof(AdjacencyLsaWithoutAdjacenciesData)));
-
-  LsaInfo lsaInfo = adjacencyLsa.getLsaInfo();
-  BOOST_CHECK_EQUAL(lsaInfo.getOriginRouter(), "test");
-  BOOST_CHECK_EQUAL(lsaInfo.getSequenceNumber(), 128);
-  BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
-
-  BOOST_CHECK_EQUAL(adjacencyLsa.hasAdjacencies(), false);
-}
-
-
-BOOST_AUTO_TEST_CASE(AdjacencyLsaClear)
-{
-  AdjacencyLsa adjacencyLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  adjacencyLsa.setLsaInfo(lsaInfo);
-
-  Adjacency adjacency1;
-  adjacency1.setName("test1");
-  adjacency1.setUri("test1");
-  adjacency1.setCost(128);
-  adjacencyLsa.addAdjacency(adjacency1);
-  BOOST_CHECK_EQUAL(adjacencyLsa.getAdjacencies().size(), 1);
-
-  std::list<Adjacency> adjacencies = adjacencyLsa.getAdjacencies();
-  std::list<Adjacency>::const_iterator it = adjacencies.begin();
-  BOOST_CHECK_EQUAL(it->getName(), "test1");
-  BOOST_CHECK_EQUAL(it->getUri(), "test1");
-  BOOST_CHECK_EQUAL(it->getCost(), 128);
-
-  adjacencyLsa.clearAdjacencies();
-  BOOST_CHECK_EQUAL(adjacencyLsa.getAdjacencies().size(), 0);
-
-  Adjacency adjacency2;
-  adjacency2.setName("test2");
-  adjacency2.setUri("test2");
-  adjacency2.setCost(128);
-  adjacencyLsa.addAdjacency(adjacency2);
-  BOOST_CHECK_EQUAL(adjacencyLsa.getAdjacencies().size(), 1);
-
-  adjacencies = adjacencyLsa.getAdjacencies();
-  it = adjacencies.begin();
-  BOOST_CHECK_EQUAL(it->getName(), "test2");
-  BOOST_CHECK_EQUAL(it->getUri(), "test2");
-  BOOST_CHECK_EQUAL(it->getCost(), 128);
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyLsaOutputStream)
-{
-  AdjacencyLsa adjacencyLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  adjacencyLsa.setLsaInfo(lsaInfo);
-
-  Adjacency adjacency1;
-  adjacency1.setName("test1");
-  adjacency1.setUri("test1");
-  adjacency1.setCost(128);
-  adjacencyLsa.addAdjacency(adjacency1);
-
-  Adjacency adjacency2;
-  adjacency2.setName("test2");
-  adjacency2.setUri("test2");
-  adjacency2.setCost(128);
-  adjacencyLsa.addAdjacency(adjacency2);
-
-  std::ostringstream os;
-  os << adjacencyLsa;
-
-  BOOST_CHECK_EQUAL(os.str(), "AdjacencyLsa("
-                                "LsaInfo("
-                                  "OriginRouter: /test, "
-                                  "SequenceNumber: 128, "
-                                  "ExpirationPeriod: 10000 milliseconds), "
-                                "Adjacency(Name: /test1, Uri: test1, Cost: 128), "
-                                "Adjacency(Name: /test2, Uri: test2, Cost: 128))");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-adjacency.cpp b/tests/tlv/test-adjacency.cpp
deleted file mode 100644
index 6e3b754..0000000
--- a/tests/tlv/test-adjacency.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "tlv/adjacency.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestAdjacency)
-
-const uint8_t AdjacencyData[] =
-{
-  // Header
-  0x84, 0x30,
-  // Name
-  0x07, 0x16, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x08, 0x09, 0x61, 0x64, 0x6a, 0x61,
-  0x63, 0x65, 0x6e, 0x63, 0x79, 0x08, 0x03, 0x74, 0x6c, 0x76,
-  // Uri
-  0x8d, 0x13, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x61, 0x64, 0x6a, 0x61, 0x63, 0x65,
-  0x6e, 0x63, 0x79, 0x2f, 0x74, 0x6c, 0x76,
-  // Cost
-  0x8c, 0x01, 0x80
-};
-
-BOOST_AUTO_TEST_CASE(AdjacencyEncode)
-{
-  Adjacency adjacency;
-  adjacency.setName("/test/adjacency/tlv");
-  adjacency.setUri("/test/adjacency/tlv");
-  adjacency.setCost(128);
-
-  const ndn::Block& wire = adjacency.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(AdjacencyData,
-                                  AdjacencyData + sizeof(AdjacencyData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyDecode)
-{
-  Adjacency adjacency;
-
-  adjacency.wireDecode(ndn::Block(AdjacencyData, sizeof(AdjacencyData)));
-
-  ndn::Name name("/test/adjacency/tlv");
-  BOOST_REQUIRE_EQUAL(adjacency.getName(), name);
-  BOOST_REQUIRE_EQUAL(adjacency.getUri(), "/test/adjacency/tlv");
-  BOOST_REQUIRE_EQUAL(adjacency.getCost(), 128);
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyOutputStream)
-{
-  Adjacency adjacency;
-  adjacency.setName("/test/adjacency/tlv");
-  adjacency.setUri("/test/adjacency/tlv");
-  adjacency.setCost(128);
-
-  std::ostringstream os;
-  os << adjacency;
-
-  BOOST_CHECK_EQUAL(os.str(), "Adjacency(Name: /test/adjacency/tlv, "
-                              "Uri: /test/adjacency/tlv, "
-                              "Cost: 128)");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-coordinate-lsa.cpp b/tests/tlv/test-coordinate-lsa.cpp
deleted file mode 100644
index 225c708..0000000
--- a/tests/tlv/test-coordinate-lsa.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "tlv/coordinate-lsa.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestCoordinateLsa)
-
-const uint8_t CoordinateLsaData[] =
-{
-  // Header
-  0x85, 0x27,
-  // LsaInfo
-  0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
-  0x80, 0x8b, 0x02, 0x27, 0x10,
-  // HyperbolicRadius
-  0x87, 0x08, 0x3f, 0xfa, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66,
-  // HyperbolicAngle
-  0x88, 0x08, 0x3f, 0xfc, 0x7a, 0xe1, 0x47, 0xae, 0x14, 0x7b
-
-};
-
-BOOST_AUTO_TEST_CASE(CoordinateLsaEncode)
-{
-  CoordinateLsa coordinateLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  coordinateLsa.setLsaInfo(lsaInfo);
-
-  coordinateLsa.setHyperbolicRadius(1.65);
-  std::vector<double> angles;
-  angles.push_back(1.78);
-  coordinateLsa.setHyperbolicAngle(angles);
-
-  const ndn::Block& wire = coordinateLsa.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(CoordinateLsaData,
-                                  CoordinateLsaData + sizeof(CoordinateLsaData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(CoordinateLsaDecode)
-{
-  CoordinateLsa coordinateLsa;
-
-  coordinateLsa.wireDecode(ndn::Block(CoordinateLsaData, sizeof(CoordinateLsaData)));
-
-  BOOST_REQUIRE_EQUAL(coordinateLsa.getLsaInfo().getOriginRouter(), "test");
-  BOOST_REQUIRE_EQUAL(coordinateLsa.getLsaInfo().getSequenceNumber(), 128);
-  BOOST_REQUIRE_EQUAL(coordinateLsa.getLsaInfo().getExpirationPeriod(),
-                      ndn::time::milliseconds(10000));
-  BOOST_REQUIRE_EQUAL(coordinateLsa.getHyperbolicRadius(), 1.65);
-  std::vector<double> angles = {1.78};
-  BOOST_REQUIRE(coordinateLsa.getHyperbolicAngle() == angles);
-}
-
-BOOST_AUTO_TEST_CASE(CoordinateLsaOutputStream)
-{
-  CoordinateLsa coordinateLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  coordinateLsa.setLsaInfo(lsaInfo);
-
-  coordinateLsa.setHyperbolicRadius(1.65);
-  std::vector<double> angles = {1.78};
-  coordinateLsa.setHyperbolicAngle(angles);
-
-  std::ostringstream os;
-  os << coordinateLsa;
-
-  BOOST_CHECK_EQUAL(os.str(), "CoordinateLsa("
-                                "LsaInfo(OriginRouter: /test, "
-                                        "SequenceNumber: 128, "
-                                        "ExpirationPeriod: 10000 milliseconds), "
-                                "HyperbolicRadius: 1.65, "
-                                "HyperbolicAngles: 1.78)");
-
-  angles.push_back(3.21);
-  coordinateLsa.setHyperbolicAngle(angles);
-
-  std::ostringstream os2;
-  os2 << coordinateLsa;
-
-  BOOST_CHECK_EQUAL(os2.str(), "CoordinateLsa("
-                                "LsaInfo(OriginRouter: /test, "
-                                        "SequenceNumber: 128, "
-                                        "ExpirationPeriod: 10000 milliseconds), "
-                                "HyperbolicRadius: 1.65, "
-                                "HyperbolicAngles: 1.78, 3.21)");
-}
-
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-destination.cpp b/tests/tlv/test-destination.cpp
index 8e2d177..adc153e 100644
--- a/tests/tlv/test-destination.cpp
+++ b/tests/tlv/test-destination.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
diff --git a/tests/tlv/test-lsa-info.cpp b/tests/tlv/test-lsa-info.cpp
deleted file mode 100644
index 46157a5..0000000
--- a/tests/tlv/test-lsa-info.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "tlv/lsa-info.hpp"
-
-#include "tests/boost-test.hpp"
-#include "tests/mocks/lsa.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestLsaInfo)
-
-const uint8_t LsaInfoData[] =
-{
-  // Header
-  0x80, 0x21,
-  // OriginRouter
-  0x81, 0x18, 0x07, 0x16, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x08, 0x03, 0x6c, 0x73,
-  0x61, 0x08, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x08, 0x03, 0x74, 0x6c, 0x76,
-  // SequenceNumber
-  0x82, 0x01, 0x80,
-  // ExpirationPeriod
-  0x8b, 0x02, 0x27, 0x10
-};
-
-const uint8_t LsaInfoDataInfiniteExpirationPeriod[] =
-{
-  // Header
-  0x80, 0x1d,
-  // OriginRouter
-  0x81, 0x18, 0x07, 0x16, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x08, 0x03, 0x6c, 0x73,
-  0x61, 0x08, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x08, 0x03, 0x74, 0x6c, 0x76,
-  // SequenceNumber
-  0x82, 0x1, 0x80
-};
-
-BOOST_AUTO_TEST_CASE(LsaInfoEncode)
-{
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("/test/lsa/info/tlv");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-
-  const ndn::Block& wire = lsaInfo.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(LsaInfoData,
-                                  LsaInfoData + sizeof(LsaInfoData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(LsaInfoDecode)
-{
-  LsaInfo lsaInfo;
-
-  lsaInfo.wireDecode(ndn::Block(LsaInfoData, sizeof(LsaInfoData)));
-
-  ndn::Name originRouter("/test/lsa/info/tlv");
-  BOOST_REQUIRE_EQUAL(lsaInfo.getOriginRouter(), originRouter);
-  BOOST_REQUIRE_EQUAL(lsaInfo.getSequenceNumber(), 128);
-  BOOST_REQUIRE_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
-  BOOST_REQUIRE_EQUAL(lsaInfo.hasInfiniteExpirationPeriod(), false);
-}
-
-BOOST_AUTO_TEST_CASE(LsaInfoInfiniteExpirationPeriodEncode)
-{
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("/test/lsa/info/tlv");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(LsaInfo::INFINITE_EXPIRATION_PERIOD);
-
-  const ndn::Block& wire = lsaInfo.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(LsaInfoDataInfiniteExpirationPeriod,
-                                  LsaInfoDataInfiniteExpirationPeriod +
-                                    sizeof(LsaInfoDataInfiniteExpirationPeriod),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(LsaInfoInfiniteExpirationPeriodDecode)
-{
-  LsaInfo lsaInfo;
-
-  lsaInfo.wireDecode(ndn::Block(LsaInfoDataInfiniteExpirationPeriod,
-                                sizeof(LsaInfoDataInfiniteExpirationPeriod)));
-
-  ndn::Name originRouter("/test/lsa/info/tlv");
-  BOOST_REQUIRE_EQUAL(lsaInfo.getOriginRouter(), originRouter);
-  BOOST_REQUIRE_EQUAL(lsaInfo.getSequenceNumber(), 128);
-  BOOST_REQUIRE_EQUAL(lsaInfo.getExpirationPeriod(), LsaInfo::INFINITE_EXPIRATION_PERIOD);
-  BOOST_REQUIRE_EQUAL(lsaInfo.hasInfiniteExpirationPeriod(), true);
-}
-
-BOOST_AUTO_TEST_CASE(LsaInfoOutputStream)
-{
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("/test/lsa/info/tlv");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-
-  std::ostringstream os;
-  os << lsaInfo;
-
-  BOOST_CHECK_EQUAL(os.str(), "LsaInfo(OriginRouter: /test/lsa/info/tlv, SequenceNumber: 128, "
-                              "ExpirationPeriod: 10000 milliseconds)");
-}
-
-BOOST_AUTO_TEST_CASE(LsaInfoMake)
-{
-  nlsr::test::MockLsa lsa;
-  lsa.setOrigRouter("/test/lsa/info/tlv");
-  lsa.setLsSeqNo(128);
-  lsa.setExpirationTimePoint(ndn::time::system_clock::now());
-
-  std::shared_ptr<LsaInfo> lsaInfo = makeLsaInfo(lsa);
-  BOOST_CHECK_EQUAL(lsaInfo->getOriginRouter(), lsa.getOrigRouter());
-  BOOST_CHECK_EQUAL(lsaInfo->getSequenceNumber(), lsa.getLsSeqNo());
-  BOOST_CHECK_LE(lsaInfo->getExpirationPeriod(), ndn::time::milliseconds(0));
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-name-lsa.cpp b/tests/tlv/test-name-lsa.cpp
deleted file mode 100644
index 885d225..0000000
--- a/tests/tlv/test-name-lsa.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California,
- *                           Arizona Board of Regents.
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.  See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#include "tlv/name-lsa.hpp"
-
-#include "tests/boost-test.hpp"
-
-namespace nlsr {
-namespace tlv {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TlvTestNameLsa)
-
-const uint8_t NameLsaWithNamesData[] =
-{
-  // Header
-  0x89, 0x25,
-  // LsaInfo
-  0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
-  0x80, 0x8b, 0x02, 0x27, 0x10,
-  // Name
-  0x07, 0x07, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, 0x31,
-  // Name
-  0x07, 0x07, 0x08, 0x05, 0x74, 0x65, 0x73, 0x74, 0x32
-};
-
-const uint8_t NameLsaWithoutNamesData[] =
-{
-  // Header
-  0x89, 0x13,
-  // LsaInfo
-  0x80, 0x11, 0x81, 0x08, 0x07, 0x06, 0x08, 0x04, 0x74, 0x65, 0x73, 0x74, 0x82, 0x01,
-  0x80, 0x8b, 0x02, 0x27, 0x10,
-};
-
-BOOST_AUTO_TEST_CASE(NameLsaEncodeWithNames)
-{
-  NameLsa nameLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  nameLsa.setLsaInfo(lsaInfo);
-
-  nameLsa.addName("test1");
-  nameLsa.addName("test2");
-
-  const ndn::Block& wire = nameLsa.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(NameLsaWithNamesData,
-                                  NameLsaWithNamesData + sizeof(NameLsaWithNamesData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(NameLsaDecodeWithNames)
-{
-  NameLsa nameLsa;
-
-  nameLsa.wireDecode(ndn::Block(NameLsaWithNamesData, sizeof(NameLsaWithNamesData)));
-
-  LsaInfo lsaInfo = nameLsa.getLsaInfo();
-  BOOST_CHECK_EQUAL(lsaInfo.getOriginRouter(), "test");
-  BOOST_CHECK_EQUAL(lsaInfo.getSequenceNumber(), 128);
-  BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
-
-  BOOST_CHECK_EQUAL(nameLsa.hasNames(), true);
-  std::list<ndn::Name> names = nameLsa.getNames();
-  std::list<ndn::Name>::const_iterator it = names.begin();
-  BOOST_CHECK_EQUAL(*it, "test1");
-
-  it++;
-  BOOST_CHECK_EQUAL(*it, "test2");
-}
-
-BOOST_AUTO_TEST_CASE(NameLsaEncodeWithoutNames)
-{
-  NameLsa nameLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  nameLsa.setLsaInfo(lsaInfo);
-
-  const ndn::Block& wire = nameLsa.wireEncode();
-
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(NameLsaWithoutNamesData,
-                                  NameLsaWithoutNamesData + sizeof(NameLsaWithoutNamesData),
-                                  wire.begin(), wire.end());
-}
-
-BOOST_AUTO_TEST_CASE(NameLsaDecodeWithoutNames)
-{
-  NameLsa nameLsa;
-
-  nameLsa.wireDecode(ndn::Block(NameLsaWithoutNamesData, sizeof(NameLsaWithoutNamesData)));
-
-  LsaInfo lsaInfo = nameLsa.getLsaInfo();
-  BOOST_CHECK_EQUAL(lsaInfo.getOriginRouter(), "test");
-  BOOST_CHECK_EQUAL(lsaInfo.getSequenceNumber(), 128);
-  BOOST_CHECK_EQUAL(lsaInfo.getExpirationPeriod(), ndn::time::milliseconds(10000));
-
-  BOOST_CHECK_EQUAL(nameLsa.hasNames(), false);
-}
-
-BOOST_AUTO_TEST_CASE(NameLsaClear)
-{
-  NameLsa nameLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  nameLsa.setLsaInfo(lsaInfo);
-
-  nameLsa.addName("test1");
-  BOOST_CHECK_EQUAL(nameLsa.getNames().size(), 1);
-
-  std::list<ndn::Name> names = nameLsa.getNames();
-  std::list<ndn::Name>::const_iterator it = names.begin();
-  BOOST_CHECK_EQUAL(*it, "test1");
-
-  nameLsa.clearNames();
-  BOOST_CHECK_EQUAL(nameLsa.getNames().size(), 0);
-
-  nameLsa.addName("test2");
-  BOOST_CHECK_EQUAL(nameLsa.getNames().size(), 1);
-
-  names = nameLsa.getNames();
-  it = names.begin();
-  BOOST_CHECK_EQUAL(*it, "test2");
-}
-
-BOOST_AUTO_TEST_CASE(AdjacencyLsaOutputStream)
-{
-  NameLsa nameLsa;
-
-  LsaInfo lsaInfo;
-  lsaInfo.setOriginRouter("test");
-  lsaInfo.setSequenceNumber(128);
-  lsaInfo.setExpirationPeriod(ndn::time::milliseconds(10000));
-  nameLsa.setLsaInfo(lsaInfo);
-
-  nameLsa.addName("test1");
-  nameLsa.addName("test2");
-
-  std::ostringstream os;
-  os << nameLsa;
-
-  BOOST_CHECK_EQUAL(os.str(), "NameLsa("
-                                "LsaInfo("
-                                  "OriginRouter: /test, "
-                                  "SequenceNumber: 128, "
-                                  "ExpirationPeriod: 10000 milliseconds), "
-                                "Name: /test1, "
-                                "Name: /test2)");
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace tlv
-} // namespace nlsr
diff --git a/tests/tlv/test-nexthops.cpp b/tests/tlv/test-nexthops.cpp
index 12a479e..f5b4d29 100644
--- a/tests/tlv/test-nexthops.cpp
+++ b/tests/tlv/test-nexthops.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
diff --git a/tests/tlv/test-routing-table-entry.cpp b/tests/tlv/test-routing-table-entry.cpp
index 378dfd9..338945b 100644
--- a/tests/tlv/test-routing-table-entry.cpp
+++ b/tests/tlv/test-routing-table-entry.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
diff --git a/tests/tlv/test-routing-table.cpp b/tests/tlv/test-routing-table.cpp
index ba8cef6..70c25c9 100644
--- a/tests/tlv/test-routing-table.cpp
+++ b/tests/tlv/test-routing-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2019,  The University of Memphis,
+ * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -107,7 +107,6 @@
 BOOST_AUTO_TEST_CASE(RoutingTableDecode2)
 {
   RoutingTableStatus rtStatus;
-
   rtStatus.wireDecode(ndn::Block(RoutingTableData2, sizeof(RoutingTableData2)));
 
   BOOST_CHECK_EQUAL(rtStatus.hasRoutingTable(), false);
diff --git a/tests/update/test-nfd-rib-command-processor.cpp b/tests/update/test-nfd-rib-command-processor.cpp
index 514fa1c..47f02c5 100644
--- a/tests/update/test-nfd-rib-command-processor.cpp
+++ b/tests/update/test-nfd-rib-command-processor.cpp
@@ -66,7 +66,7 @@
     ndn::Name lsaInterestName = conf.getLsaPrefix();
     lsaInterestName.append(conf.getSiteName());
     lsaInterestName.append(conf.getRouterName());
-    lsaInterestName.append(std::to_string(Lsa::Type::NAME));
+    lsaInterestName.append(boost::lexical_cast<std::string>(Lsa::Type::NAME));
     lsaInterestName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 
     face.receive(ndn::Interest(lsaInterestName).setCanBePrefix(true));
diff --git a/tests/update/test-prefix-update-processor.cpp b/tests/update/test-prefix-update-processor.cpp
index 711935f..ca887d1 100644
--- a/tests/update/test-prefix-update-processor.cpp
+++ b/tests/update/test-prefix-update-processor.cpp
@@ -102,7 +102,7 @@
     ndn::Name lsaInterestName = conf.getLsaPrefix();
     lsaInterestName.append(conf.getSiteName());
     lsaInterestName.append(conf.getRouterName());
-    lsaInterestName.append(std::to_string(Lsa::Type::NAME));
+    lsaInterestName.append(boost::lexical_cast<std::string>(Lsa::Type::NAME));
 
     lsaInterestName.appendNumber(nlsr.m_lsdb.m_sequencingManager.getNameLsaSeq());
 
