diff --git a/tests/route/test-fib.cpp b/tests/route/test-fib.cpp
index a902eb7..932b63a 100644
--- a/tests/route/test-fib.cpp
+++ b/tests/route/test-fib.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2023,  The University of Memphis,
  *                           Regents of the University of California
  *
  * This file is part of NLSR (Named-data Link State Routing).
@@ -39,7 +39,6 @@
     , fib(face, m_scheduler, adjacencies, conf, m_keyChain)
     , interests(face.sentInterests)
   {
-    enableRegistrationReplyWithFaceId();
     advanceClocks(1_s);
 
     Adjacent neighbor1(router1Name, ndn::FaceUri(router1FaceUri), 0, Adjacent::STATUS_ACTIVE, 0, router1FaceId);
@@ -56,36 +55,6 @@
     fib.setEntryRefreshTime(1);
   }
 
-  void
-  enableRegistrationReplyWithFaceId()
-  {
-    face.onSendInterest.connect([this] (const auto& interest) {
-      if (!RIB_COMMAND_PREFIX.isPrefixOf(interest.getName()))
-        return;
-
-      ndn::name::Component verb;
-      ndn::nfd::ControlParameters params;
-      extractRibCommandParameters(interest, verb, params);
-      if (!params.hasFaceId()) {
-        params.setFaceId(1);
-      }
-      params.setOrigin(ndn::nfd::ROUTE_ORIGIN_APP);
-      if (verb == ndn::name::Component("register")) {
-        params.setCost(0);
-      }
-
-      ndn::nfd::ControlResponse resp;
-      resp.setCode(200);
-      resp.setBody(params.wireEncode());
-
-      ndn::Data data(interest.getName());
-      data.setContent(resp.wireEncode());
-      m_keyChain.sign(data, ndn::security::SigningInfo(ndn::security::SigningInfo::SIGNER_TYPE_SHA256));
-
-      face.getIoService().post([this, data] { face.receive(data); });
-    });
-  }
-
   static void
   extractRibCommandParameters(const ndn::Interest& interest,
                               ndn::Name::Component& verb,
@@ -102,7 +71,12 @@
   ndn::Scheduler m_scheduler{m_io};
 
 public:
-  ndn::util::DummyClientFace face{m_io, m_keyChain};
+  ndn::util::DummyClientFace face{m_io, m_keyChain, [] {
+    ndn::util::DummyClientFace::Options opts;
+    opts.enableRegistrationReply = true;
+    opts.registrationReplyFaceId = 128;
+    return opts;
+  } ()};
   ConfParameter conf{face, m_keyChain};
   AdjacencyList& adjacencies;
   Fib fib;
diff --git a/tests/test-nlsr.cpp b/tests/test-nlsr.cpp
index e888acf..b4f979c 100644
--- a/tests/test-nlsr.cpp
+++ b/tests/test-nlsr.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2022,  The University of Memphis,
+ * Copyright (c) 2014-2023,  The University of Memphis,
  *                           Regents of the University of California,
  *                           Arizona Board of Regents.
  *
@@ -207,7 +207,7 @@
 BOOST_AUTO_TEST_CASE(FaceCreateEvent)
 {
   // Setting constants for the unit test
-  const uint32_t faceId = 1;
+  const uint32_t faceId = 128;
   const std::string faceUri = "udp4://10.0.0.1:6363";
 
   Adjacent neighbor("/ndn/neighborA", ndn::FaceUri(faceUri), 10,
@@ -241,7 +241,7 @@
 BOOST_AUTO_TEST_CASE(FaceCreateEventNoMatch)
 {
   // Setting constants for the unit test
-  const uint32_t faceId = 1;
+  const uint32_t faceId = 128;
   const std::string eventUri = "udp4://10.0.0.1:6363";
   const std::string neighborUri = "udp4://10.0.0.2:6363";
 
@@ -272,10 +272,7 @@
 
 BOOST_AUTO_TEST_CASE(FaceCreateEventAlreadyConfigured)
 {
-  // So if NLSR gets the notification and registers prefixes it
-  // will change the Id to 1 and our tests will fail
-  // Need to disable registrationReply in dummy face and have own registration reply in the future
-  const uint32_t neighborFaceId = 1;
+  const uint32_t neighborFaceId = 128;
   const std::string faceUri = "udp4://10.0.0.1:6363";
 
   Adjacent neighbor("/ndn/neighborA", ndn::FaceUri(faceUri), 10,
@@ -289,7 +286,7 @@
   ndn::nfd::FaceEventNotification event;
   event.setKind(ndn::nfd::FACE_EVENT_CREATED)
     .setRemoteUri(faceUri)
-    .setFaceId(neighborFaceId); // Does not matter what we set here, dummy face always returns 1
+    .setFaceId(neighborFaceId);
   auto data = std::make_shared<ndn::Data>(ndn::Name("/localhost/nfd/faces/events").appendSequenceNumber(0));
   data->setFreshnessPeriod(1_s);
   data->setContent(event.wireEncode());
@@ -299,7 +296,6 @@
   // Move the clocks forward so that the Face processes the event.
   this->advanceClocks(10_ms);
 
-  // Check that the neighbor is configured with the face id of 1
   auto iterator = conf.getAdjacencyList().findAdjacent(ndn::FaceUri(faceUri));
   BOOST_REQUIRE(iterator != conf.getAdjacencyList().end());
   BOOST_CHECK_EQUAL(iterator->getFaceId(), neighborFaceId);
