diff --git a/tests/route/test-name-prefix-table.cpp b/tests/route/test-name-prefix-table.cpp
index 9585106..fbe6c5a 100644
--- a/tests/route/test-name-prefix-table.cpp
+++ b/tests/route/test-name-prefix-table.cpp
@@ -20,7 +20,9 @@
  */
 
 #include "route/name-prefix-table.hpp"
-#include "nlsr.hpp"
+#include "route/fib.hpp"
+#include "route/routing-table.hpp"
+#include "lsdb.hpp"
 #include "../test-common.hpp"
 
 #include <ndn-cxx/util/dummy-client-face.hpp>
@@ -34,32 +36,38 @@
   NamePrefixTableFixture()
     : face(m_ioService, m_keyChain)
     , conf(face, m_keyChain)
-    , nlsr(face, m_keyChain, conf)
-    , lsdb(nlsr.m_lsdb)
-    , npt(nlsr.m_namePrefixTable)
+    , confProcessor(conf)
+    , lsdb(face, m_keyChain, conf)
+    , fib(face, m_scheduler, conf.getAdjacencyList(), conf, m_keyChain)
+    , rt(m_scheduler, lsdb, conf)
+    , npt(conf.getRouterPrefix(), fib, rt, rt.afterRoutingChange, lsdb.onLsdbModified)
   {
   }
 
+  bool
+  isNameInNpt(const ndn::Name& name)
+  {
+    auto it = std::find_if(npt.begin(), npt.end(),
+                           [&] (const auto& entry) { return name == entry->getNamePrefix(); });
+    return it != npt.end();
+  }
+
 public:
   ndn::util::DummyClientFace face;
   ConfParameter conf;
-  Nlsr nlsr;
+  DummyConfFileProcessor confProcessor;
 
-  Lsdb& lsdb;
-  NamePrefixTable& npt;
+  Lsdb lsdb;
+  Fib fib;
+  RoutingTable rt;
+  NamePrefixTable npt;
 };
 
 BOOST_AUTO_TEST_SUITE(TestNamePrefixTable)
 
 BOOST_FIXTURE_TEST_CASE(Bupt, NamePrefixTableFixture)
 {
-  conf.setNetwork("/ndn");
-  conf.setSiteName("/router");
-  conf.setRouterName("/a");
-  conf.buildRouterAndSyncUserPrefix();
-
-  RoutingTable& routingTable = nlsr.m_routingTable;
-  routingTable.setRoutingCalcInterval(0);
+  rt.m_routingCalcInterval = 0_s;
 
   Adjacent thisRouter(conf.getRouterPrefix(), ndn::FaceUri("udp4://10.0.0.1"), 0, Adjacent::STATUS_ACTIVE, 0, 0);
 
@@ -265,7 +273,6 @@
 
 BOOST_FIXTURE_TEST_CASE(RoutingTableUpdate, NamePrefixTableFixture)
 {
-  RoutingTable& routingTable = nlsr.m_routingTable;
   const ndn::Name destination = ndn::Name{"/ndn/destination1"};
   NextHop hop1{"upd4://10.0.0.1", 0};
   NextHop hop2{"udp4://10.0.0.2", 1};
@@ -273,10 +280,10 @@
   const NamePrefixTableEntry entry1{"/ndn/router1"};
   npt.addEntry(entry1.getNamePrefix(), destination);
 
-  routingTable.addNextHop(destination, hop1);
-  routingTable.addNextHop(destination, hop2);
+  rt.addNextHop(destination, hop1);
+  rt.addNextHop(destination, hop2);
 
-  npt.updateWithNewRoute(routingTable.m_rTable);
+  npt.updateWithNewRoute(rt.m_rTable);
 
   // At this point the NamePrefixTableEntry should have two NextHops.
   auto nameIterator = std::find_if(npt.begin(), npt.end(),
@@ -291,8 +298,8 @@
   BOOST_CHECK_EQUAL(nextHops.size(), 2);
 
   // Add the other NextHop
-  routingTable.addNextHop(destination, hop3);
-  npt.updateWithNewRoute(routingTable.m_rTable);
+  rt.addNextHop(destination, hop3);
+  npt.updateWithNewRoute(rt.m_rTable);
 
   // At this point the NamePrefixTableEntry should have three NextHops.
   nameIterator = std::find_if(npt.begin(), npt.end(),
@@ -306,6 +313,65 @@
   BOOST_CHECK_EQUAL(nextHops.size(), 3);
 }
 
+BOOST_FIXTURE_TEST_CASE(UpdateFromLsdb, NamePrefixTableFixture)
+{
+  ndn::time::system_clock::TimePoint testTimePoint =  ndn::time::system_clock::now();
+  NamePrefixList npl1;
+  ndn::Name n1("name1");
+  ndn::Name n2("name2");
+  ndn::Name router1("/router1/1");
+
+  npl1.insert(n1);
+  npl1.insert(n2);
+
+  NameLsa nlsa1(router1, 12, testTimePoint, npl1);
+  std::shared_ptr<Lsa> lsaPtr = std::make_shared<NameLsa>(nlsa1);
+
+  BOOST_CHECK(npt.begin() == npt.end());
+  npt.updateFromLsdb(lsaPtr, LsdbUpdate::INSTALLED, {}, {});
+  BOOST_CHECK_EQUAL(npt.m_table.size(), 3); // Router + 2 names
+
+  BOOST_CHECK(isNameInNpt(n1));
+  BOOST_CHECK(isNameInNpt(n2));
+
+  ndn::Name n3("name3");
+  auto nlsa = std::static_pointer_cast<NameLsa>(lsaPtr);
+  nlsa->removeName(n2);
+  nlsa->addName(n3);
+  npt.updateFromLsdb(lsaPtr, LsdbUpdate::UPDATED, {n3}, {n2});
+  BOOST_CHECK(isNameInNpt(n1));
+  BOOST_CHECK(!isNameInNpt(n2)); // Removed
+  BOOST_CHECK(isNameInNpt(n3));
+
+  BOOST_CHECK_EQUAL(npt.m_table.size(), 3); // Still router + 2 names
+
+  npt.updateFromLsdb(lsaPtr, LsdbUpdate::REMOVED, {}, {});
+  BOOST_CHECK_EQUAL(npt.m_table.size(), 0);
+
+  // Adj and Coordinate LSAs router
+  ndn::Name router2("/router2/2");
+  AdjLsa adjLsa(router2, 12, testTimePoint, 2, conf.getAdjacencyList());
+  lsaPtr = std::make_shared<AdjLsa>(adjLsa);
+  BOOST_CHECK(npt.begin() == npt.end());
+  npt.updateFromLsdb(lsaPtr, LsdbUpdate::INSTALLED, {}, {});
+  BOOST_CHECK_EQUAL(npt.m_table.size(), 1);
+  BOOST_CHECK(isNameInNpt(router2));
+
+  npt.updateFromLsdb(lsaPtr, LsdbUpdate::REMOVED, {}, {});
+  BOOST_CHECK_EQUAL(npt.m_table.size(), 0);
+
+  ndn::Name router3("/router3/3");
+  CoordinateLsa corLsa(router3, 12, testTimePoint, 2, {3});
+  lsaPtr = std::make_shared<CoordinateLsa>(corLsa);
+  BOOST_CHECK(npt.begin() == npt.end());
+  npt.updateFromLsdb(lsaPtr, LsdbUpdate::INSTALLED, {}, {});
+  BOOST_CHECK_EQUAL(npt.m_table.size(), 1);
+  BOOST_CHECK(isNameInNpt(router3));
+
+  npt.updateFromLsdb(lsaPtr, LsdbUpdate::REMOVED, {}, {});
+  BOOST_CHECK_EQUAL(npt.m_table.size(), 0);
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace test
diff --git a/tests/route/test-routing-table.cpp b/tests/route/test-routing-table.cpp
index 0bce153..6a2971e 100644
--- a/tests/route/test-routing-table.cpp
+++ b/tests/route/test-routing-table.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  The University of Memphis,
+ * Copyright (c) 2014-2021,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -28,23 +28,25 @@
 namespace nlsr {
 namespace test {
 
-class RoutingTableFixture
+class RoutingTableFixture : public UnitTestTimeFixture
 {
 public:
   RoutingTableFixture()
-    : conf(face, keyChain)
-    , nlsr(face, keyChain, conf)
-    , rt(nlsr.m_routingTable)
+    : face(m_ioService, m_keyChain, {true, true})
+    , conf(face, m_keyChain)
+    , confProcessor(conf)
+    , lsdb(face, m_keyChain, conf)
+    , rt(m_scheduler, lsdb, conf)
   {
   }
 
 public:
   ndn::util::DummyClientFace face;
-  ndn::KeyChain keyChain;
   ConfParameter conf;
-  Nlsr nlsr;
+  DummyConfFileProcessor confProcessor;
 
-  RoutingTable& rt;
+  Lsdb lsdb;
+  RoutingTable rt;
 };
 
 BOOST_AUTO_TEST_SUITE(TestRoutingTable)
@@ -130,6 +132,83 @@
                     "    NextHop(Uri: nexthop, Cost: 99)\n");
 }
 
+BOOST_FIXTURE_TEST_CASE(UpdateFromLsdb, RoutingTableFixture)
+{
+  ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now() + 3600_s;
+  ndn::Name router2("/router2");
+  AdjLsa adjLsa(router2, 12, testTimePoint, 2, conf.getAdjacencyList());
+  std::shared_ptr<Lsa> lsaPtr = std::make_shared<AdjLsa>(adjLsa);
+  BOOST_CHECK(!rt.m_isRouteCalculationScheduled);
+  lsdb.installLsa(lsaPtr);
+  BOOST_CHECK(rt.m_isRouteCalculationScheduled);
+
+  // After 15_s (by default) routing table calculation is done
+  advanceClocks(15_s);
+  BOOST_CHECK(!rt.m_isRouteCalculationScheduled);
+
+  // Update to installed LSA
+  std::shared_ptr<Lsa> lsaPtr2 = std::make_shared<AdjLsa>(adjLsa);
+  auto adjPtr = std::static_pointer_cast<AdjLsa>(lsaPtr2);
+  adjPtr->addAdjacent(Adjacent("router3"));
+  adjPtr->setSeqNo(13);
+  lsdb.installLsa(lsaPtr2);
+  BOOST_CHECK(rt.m_isRouteCalculationScheduled);
+
+  // Insert a neighbor so that AdjLsa can be installed
+  AdjacencyList adjl;
+  Adjacent ownAdj(conf.getRouterPrefix());
+  ownAdj.setStatus(Adjacent::STATUS_ACTIVE);
+  adjl.insert(ownAdj);
+  AdjLsa adjLsa4("/router4", 12, testTimePoint, 2, adjl);
+  lsaPtr = std::make_shared<AdjLsa>(adjLsa4);
+  lsdb.installLsa(lsaPtr);
+
+  Adjacent adj("/router4");
+  adj.setStatus(Adjacent::STATUS_ACTIVE);
+  conf.getAdjacencyList().insert(adj);
+  lsdb.scheduleAdjLsaBuild();
+  BOOST_CHECK_EQUAL(rt.m_rTable.size(), 0);
+  advanceClocks(15_s);
+  BOOST_CHECK_EQUAL(rt.m_rTable.size(), 1);
+
+  rt.wireEncode();
+  BOOST_CHECK(rt.m_wire.isValid());
+  BOOST_CHECK_GT(rt.m_wire.size(), 0);
+
+  // Remove own Adj Lsa - Make sure routing table is wiped out
+  conf.getAdjacencyList().setStatusOfNeighbor("/router4", Adjacent::STATUS_INACTIVE);
+  conf.getAdjacencyList().setTimedOutInterestCount("/router4", HELLO_RETRIES_MAX);
+  lsdb.scheduleAdjLsaBuild();
+  advanceClocks(15_s);
+  BOOST_CHECK_EQUAL(rt.m_rTable.size(), 0);
+  BOOST_CHECK(!rt.m_wire.isValid());
+
+  // Check that HR routing is scheduled, once Coordinate LSA is added
+  BOOST_CHECK(!rt.m_isRouteCalculationScheduled);
+  rt.m_hyperbolicState = HYPERBOLIC_STATE_ON;
+  CoordinateLsa clsa("router5", 12, testTimePoint, 2.5, {30.0});
+  auto clsaPtr = std::make_shared<CoordinateLsa>(clsa);
+  lsdb.installLsa(clsaPtr);
+  BOOST_CHECK(rt.m_isRouteCalculationScheduled);
+
+  Adjacent router5("/router5");
+  router5.setStatus(Adjacent::STATUS_ACTIVE);
+  conf.getAdjacencyList().insert(router5);
+  conf.getAdjacencyList().setStatusOfNeighbor("/router5", Adjacent::STATUS_ACTIVE);
+  advanceClocks(15_s);
+  rt.wireEncode();
+  BOOST_CHECK(rt.m_wire.isValid());
+  BOOST_CHECK_GT(rt.m_wire.size(), 0);
+  BOOST_CHECK(!rt.m_isRouteCalculationScheduled);
+
+  // Emulate HelloProtocol neighbor down
+  conf.getAdjacencyList().setStatusOfNeighbor("/router5", Adjacent::STATUS_INACTIVE);
+  rt.scheduleRoutingTableCalculation();
+  advanceClocks(15_s);
+  BOOST_CHECK_EQUAL(rt.m_rTable.size(), 0);
+  BOOST_CHECK(!rt.m_wire.isValid());
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace test
