diff --git a/tests/unit/validator/certificate-fetcher-ndns-app-cert.cpp b/tests/unit/validator/certificate-fetcher-ndns-app-cert.cpp
index 3f236aa..e062702 100644
--- a/tests/unit/validator/certificate-fetcher-ndns-app-cert.cpp
+++ b/tests/unit/validator/certificate-fetcher-ndns-app-cert.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2019, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -26,10 +26,8 @@
 #include "mgmt/management-tool.hpp"
 
 #include "test-common.hpp"
-#include "dummy-forwarder.hpp"
 #include "unit/database-test-data.hpp"
 
-#include <ndn-cxx/util/io.hpp>
 #include <ndn-cxx/security/v2/validation-policy-simple-hierarchy.hpp>
 
 namespace ndn {
@@ -38,8 +36,8 @@
 
 BOOST_AUTO_TEST_SUITE(AppCertFetcher)
 
-unique_ptr<security::v2::Validator>
-CreateValidatorAppCert(Face& face)
+static unique_ptr<security::v2::Validator>
+makeValidatorAppCert(Face& face)
 {
   return make_unique<security::v2::Validator>(make_unique<::ndn::security::v2::ValidationPolicySimpleHierarchy>(),
                                               make_unique<CertificateFetcherAppCert>(face));
@@ -49,25 +47,28 @@
 {
 public:
   AppCertFetcherFixture()
-    : m_forwarder(m_io, m_keyChain)
-    , m_face(m_forwarder.addFace())
-    , m_validator(CreateValidatorAppCert(m_face))
+    : m_validatorFace(m_io, m_keyChain, {true, true})
+    , m_validator(makeValidatorAppCert(m_validatorFace))
   {
     // build the data and certificate for this test
     buildAppCertAndData();
 
-    auto validatorOnlyForConstructServer = NdnsValidatorBuilder::create(m_face, 10, 0, TEST_CONFIG_PATH "/" "validator.conf");
-    // initlize all servers
-    auto addServer = [&] (const Name& zoneName) {
-      Face& face = m_forwarder.addFace();
+    auto serverValidator = NdnsValidatorBuilder::create(m_validatorFace, 10, 0,
+                                                        TEST_CONFIG_PATH "/validator.conf");
+    // initialize all servers
+    auto addServer = [this, &serverValidator] (const Name& zoneName) {
+      m_serverFaces.push_back(make_unique<util::DummyClientFace>(m_io, m_keyChain,
+                                                                 util::DummyClientFace::Options{true, true}));
+      m_serverFaces.back()->linkTo(m_validatorFace);
+
       // validator is used only for check update signature
       // no updates tested here, so validator will not be used
       // passing m_validator is only for construct server
       Name certName = CertHelper::getDefaultCertificateNameOfIdentity(m_keyChain,
-                                                           Name(zoneName).append("NDNS"));
-      auto server = make_shared<NameServer>(zoneName, certName, face,
-                                            m_session, m_keyChain, *validatorOnlyForConstructServer);
-      m_servers.push_back(server);
+                                                                      Name(zoneName).append("NDNS"));
+      auto server = make_shared<NameServer>(zoneName, certName, *m_serverFaces.back(),
+                                            m_session, m_keyChain, *serverValidator);
+      m_servers.push_back(std::move(server));
     };
     addServer(m_testName);
     addServer(m_netName);
@@ -75,12 +76,6 @@
     advanceClocks(time::milliseconds(10), 1);
   }
 
-  ~AppCertFetcherFixture()
-  {
-    m_face.getIoService().stop();
-    m_face.shutdown();
-  }
-
 private:
   void
   buildAppCertAndData()
@@ -109,14 +104,13 @@
   }
 
 public:
-  DummyForwarder m_forwarder;
-  ndn::Face& m_face;
+  util::DummyClientFace m_validatorFace;
   unique_ptr<security::v2::Validator> m_validator;
+  std::vector<unique_ptr<util::DummyClientFace>> m_serverFaces;
   std::vector<shared_ptr<ndns::NameServer>> m_servers;
   Data m_appCertSignedData;
 };
 
-
 BOOST_FIXTURE_TEST_CASE(Basic, AppCertFetcherFixture)
 {
   bool hasValidated = false;
diff --git a/tests/unit/validator/validator.cpp b/tests/unit/validator/validator.cpp
index 21f6d27..c9ac644 100644
--- a/tests/unit/validator/validator.cpp
+++ b/tests/unit/validator/validator.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018, Regents of the University of California.
+ * Copyright (c) 2014-2019, Regents of the University of California.
  *
  * This file is part of NDNS (Named Data Networking Domain Name Service).
  * See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -23,11 +23,8 @@
 #include "daemon/name-server.hpp"
 
 #include "test-common.hpp"
-#include "dummy-forwarder.hpp"
 #include "unit/database-test-data.hpp"
 
-#include <ndn-cxx/util/io.hpp>
-
 namespace ndn {
 namespace ndns {
 namespace tests {
@@ -38,50 +35,47 @@
 {
 public:
   ValidatorTestFixture()
-    : m_forwarder(m_io, m_keyChain)
-    , m_face(m_forwarder.addFace())
-    , m_validator(NdnsValidatorBuilder::create(m_face, 500, 0, TEST_CONFIG_PATH "/" "validator.conf"))
+    : m_validatorFace(m_io, m_keyChain, {true, true})
+    , m_validator(NdnsValidatorBuilder::create(m_validatorFace, 500, 0,
+                                               TEST_CONFIG_PATH "/validator.conf"))
   {
     // generate a random cert
     // check how does name-server test do
-    // initlize all servers
-    auto addServer = [&] (const Name& zoneName) {
-      Face& face = m_forwarder.addFace();
+    // initialize all servers
+    auto addServer = [this] (const Name& zoneName) {
+      m_serverFaces.push_back(make_unique<util::DummyClientFace>(m_io, m_keyChain,
+                                                                 util::DummyClientFace::Options{true, true}));
+      m_serverFaces.back()->linkTo(m_validatorFace);
+
       // validator is used only for check update signature
       // no updates tested here, so validator will not be used
       // passing m_validator is only for construct server
       Name certName = CertHelper::getDefaultCertificateNameOfIdentity(m_keyChain,
                                                                       Name(zoneName).append("NDNS"));
-      auto server = make_shared<NameServer>(zoneName, certName, face,
+      auto server = make_shared<NameServer>(zoneName, certName, *m_serverFaces.back(),
                                             m_session, m_keyChain, *m_validator);
-      m_servers.push_back(server);
+      m_servers.push_back(std::move(server));
     };
     addServer(m_testName);
     addServer(m_netName);
     addServer(m_ndnsimName);
+
     m_ndnsimCert = CertHelper::getDefaultCertificateNameOfIdentity(m_keyChain,
-                                                        Name(m_ndnsimName).append("NDNS"));
+                                                                   Name(m_ndnsimName).append("NDNS"));
     m_randomCert = m_keyChain.createIdentity("/random/identity").getDefaultKey()
-    .getDefaultCertificate().getName();
+                   .getDefaultCertificate().getName();
     advanceClocks(time::milliseconds(10), 1);
   }
 
-  ~ValidatorTestFixture()
-  {
-    m_face.getIoService().stop();
-    m_face.shutdown();
-  }
-
 public:
-  DummyForwarder m_forwarder;
-  ndn::Face& m_face;
+  util::DummyClientFace m_validatorFace;
   unique_ptr<security::v2::Validator> m_validator;
+  std::vector<unique_ptr<util::DummyClientFace>> m_serverFaces;
   std::vector<shared_ptr<ndns::NameServer>> m_servers;
   Name m_ndnsimCert;
   Name m_randomCert;
 };
 
-
 BOOST_FIXTURE_TEST_CASE(Basic, ValidatorTestFixture)
 {
   SignatureInfo info;
