diff --git a/tests/dataset-fixtures.hpp b/tests/dataset-fixtures.hpp
index fbed46d..bb03bd6 100644
--- a/tests/dataset-fixtures.hpp
+++ b/tests/dataset-fixtures.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -378,12 +378,12 @@
 };
 
 
-typedef boost::mpl::vector< BasicDataset,
-                            FetchByPrefixDataset,
-                            BasicChildSelectorDataset,
-                            ExtendedChildSelectorDataset,
-                            SamePrefixDataset<10>,
-                            SamePrefixDataset<100> > CommonDatasets;
+typedef boost::mpl::vector<BasicDataset,
+                           FetchByPrefixDataset,
+                           BasicChildSelectorDataset,
+                           ExtendedChildSelectorDataset,
+                           SamePrefixDataset<10>,
+                           SamePrefixDataset<100>> CommonDatasets;
 
 
 } // namespace tests
diff --git a/tests/integrated/command-fixture.cpp b/tests/integrated/command-fixture.cpp
index 1680dad..a803a51 100644
--- a/tests/integrated/command-fixture.cpp
+++ b/tests/integrated/command-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -25,6 +25,7 @@
 CommandFixture::CommandFixture()
   : scheduler(repoFace.getIoService())
   , keyChain(m_keyChain)
+  , dispatcher(repoFace, keyChain)
   , validator(repoFace)
 {
   this->saveIdentityCertificate(keyChain.getPib().getDefaultIdentity().getName(),
diff --git a/tests/integrated/command-fixture.hpp b/tests/integrated/command-fixture.hpp
index fa2fdd9..601f0b9 100644
--- a/tests/integrated/command-fixture.hpp
+++ b/tests/integrated/command-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -22,6 +22,7 @@
 
 #include "../identity-management-fixture.hpp"
 #include <ndn-cxx/security/validator-null.hpp>
+#include <ndn-cxx/mgmt/dispatcher.hpp>
 
 namespace repo {
 namespace tests {
@@ -35,7 +36,7 @@
   Face repoFace;
   Scheduler scheduler;
   KeyChain& keyChain;
-
+  ndn::mgmt::Dispatcher dispatcher;
   /// \todo #4091 switch to ValidatorPolicyConf and load insert-delete-validator-config.conf
   ValidatorConfig validator;
 };
diff --git a/tests/integrated/insert-delete-validator-config.conf b/tests/integrated/insert-delete-validator-config.conf
index 8a777c5..c97bb4c 100644
--- a/tests/integrated/insert-delete-validator-config.conf
+++ b/tests/integrated/insert-delete-validator-config.conf
@@ -15,19 +15,20 @@
   }
   checker
   {
-    type fixed-signer
+    type customized
     sig-type rsa-sha256
-    signer
+    key-locator
     {
-      type file
-      file-name "insert-delete-test.cert"
+      type name
+      name /DEFAULT
+      relation equal
     }
   }
 }
 
 rule
 {
-  id "Test Rule For Datat"
+  id "Test Rule For Data"
   for data
   filter
   {
@@ -37,12 +38,19 @@
   }
   checker
   {
-    type fixed-signer
+    type customized
     sig-type rsa-sha256
-    signer
+    key-locator
     {
-      type file
-      file-name "insert-delete-test.cert"
+      type name
+      name /DEFAULT
+      relation equal
     }
   }
-}
\ No newline at end of file
+}
+
+trust-anchor
+{
+  type file
+  file-name "insert-delete-test.cert"
+}
diff --git a/tests/integrated/test-basic-command-insert-delete.cpp b/tests/integrated/test-basic-command-insert-delete.cpp
index ff4b866..ea58abe 100644
--- a/tests/integrated/test-basic-command-insert-delete.cpp
+++ b/tests/integrated/test-basic-command-insert-delete.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -17,20 +17,28 @@
  * repo-ng, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "handles/write-handle.hpp"
 #include "handles/delete-handle.hpp"
-#include "storage/sqlite-storage.hpp"
+#include "handles/write-handle.hpp"
+
 #include "storage/repo-storage.hpp"
+#include "storage/sqlite-storage.hpp"
 
 #include "command-fixture.hpp"
 #include "../repo-storage-fixture.hpp"
 #include "../dataset-fixtures.hpp"
 
+#include <ndn-cxx/security/command-interest-signer.hpp>
+#include <ndn-cxx/security/signing-helpers.hpp>
 #include <ndn-cxx/util/random.hpp>
+#include <ndn-cxx/util/time.hpp>
 
+#include <boost/asio/io_service.hpp>
 #include <boost/mpl/vector.hpp>
 #include <boost/test/unit_test.hpp>
 
+
+#include <iostream>
+
 namespace repo {
 namespace tests {
 
@@ -48,8 +56,8 @@
 {
 public:
   Fixture()
-    : writeHandle(repoFace, *handle, keyChain, scheduler, validator)
-    , deleteHandle(repoFace, *handle, keyChain, scheduler, validator)
+    : writeHandle(repoFace, *handle, dispatcher, scheduler, validator)
+    , deleteHandle(repoFace, *handle, dispatcher, scheduler, validator)
     , insertFace(repoFace.getIoService())
     , deleteFace(repoFace.getIoService())
   {
@@ -58,8 +66,6 @@
       [] (const Name& cmdPrefix, const std::string& reason) {
         BOOST_FAIL("Command prefix registration error: " << reason);
       });
-    writeHandle.listen(cmdPrefix);
-    deleteHandle.listen(cmdPrefix);
   }
 
   void
@@ -114,7 +120,7 @@
 {
   Data data(Name(interest.getName()));
   data.setContent(content, sizeof(content));
-  data.setFreshnessPeriod(milliseconds(0));
+  data.setFreshnessPeriod(0_ms);
   keyChain.sign(data);
   insertFace.put(data);
   std::map<Name, EventId>::iterator event = insertEvents.find(interest.getName());
@@ -123,7 +129,7 @@
     insertEvents.erase(event);
   }
   // schedule an event 50ms later to check whether insert is Ok
-  scheduler.scheduleEvent(milliseconds(500),
+  scheduler.scheduleEvent(500_ms,
                           bind(&Fixture<T>::checkInsertOk, this, interest));
 
 }
@@ -146,9 +152,8 @@
 {
   RepoCommandResponse response;
   response.wireDecode(data.getContent().blockFromValue());
-  int statusCode = response.getStatusCode();
+  int statusCode = response.getCode();
   BOOST_CHECK_EQUAL(statusCode, 100);
-  //  std::cout<<"statuse code of insert name = "<<response.getName()<<std::endl;
 }
 
 template<class T> void
@@ -156,11 +161,11 @@
 {
   RepoCommandResponse response;
   response.wireDecode(data.getContent().blockFromValue());
-  int statusCode = response.getStatusCode();
+  int statusCode = response.getCode();
   BOOST_CHECK_EQUAL(statusCode, 200);
 
   //schedlute an event to check whether delete is Ok.
-  scheduler.scheduleEvent(milliseconds(100),
+  scheduler.scheduleEvent(100_ms,
                           bind(&Fixture<T>::checkDeleteOk, this, interest));
 }
 
@@ -204,7 +209,7 @@
     BOOST_CHECK_EQUAL(rc, 0);
   }
   else {
-    std::cerr<<"Check Insert Failed"<<std::endl;
+    BOOST_ERROR("Check Insert Failed");
   }
 }
 
@@ -229,11 +234,11 @@
     insertCommandName.append(insertParameter.wireEncode());
     Interest insertInterest(insertCommandName);
     keyChain.sign(insertInterest);
-    //schedule a job to express insertInterest every 50ms
+
+    // schedule a job to express insertInterest every 50ms
     scheduler.scheduleEvent(milliseconds(timeCount * 50 + 1000),
                             bind(&Fixture<T>::sendInsertInterest, this, insertInterest));
-    //schedule what to do when interest timeout
-
+    // schedule what to do when interest timeout
     EventId delayEventId = scheduler.scheduleEvent(milliseconds(5000 + timeCount * 50),
                                                    bind(&Fixture<T>::delayedInterest, this));
     insertEvents[insertParameter.getName()] = delayEventId;
@@ -266,21 +271,21 @@
   }
 }
 
-typedef boost::mpl::vector< BasicDataset,
-                            FetchByPrefixDataset,
-                            BasicChildSelectorDataset,
-                            ExtendedChildSelectorDataset,
-                            SamePrefixDataset<10> > Datasets;
+typedef boost::mpl::vector<BasicDataset,
+                           FetchByPrefixDataset,
+                           BasicChildSelectorDataset,
+                           ExtendedChildSelectorDataset,
+                           SamePrefixDataset<10>> Datasets;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(InsertDelete, T, Datasets, Fixture<T>)
 {
   // schedule events
-  this->scheduler.scheduleEvent(seconds(0),
+  this->scheduler.scheduleEvent(0_s,
                                 bind(&Fixture<T>::scheduleInsertEvent, this));
-  this->scheduler.scheduleEvent(seconds(10),
+  this->scheduler.scheduleEvent(10_s,
                                 bind(&Fixture<T>::scheduleDeleteEvent, this));
 
-  this->repoFace.processEvents(seconds(30));
+  this->repoFace.processEvents(30_s);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/integrated/test-basic-command-watch.cpp b/tests/integrated/test-basic-command-watch.cpp
index 1e38da9..6fe677d 100644
--- a/tests/integrated/test-basic-command-watch.cpp
+++ b/tests/integrated/test-basic-command-watch.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -46,7 +46,7 @@
 {
 public:
   Fixture()
-    : watchHandle(repoFace, *handle, keyChain, scheduler, validator)
+    : watchHandle(repoFace, *handle, dispatcher, scheduler, validator)
     , watchFace(repoFace.getIoService())
   {
     Name cmdPrefix("/repo/command");
@@ -54,7 +54,6 @@
       [] (const Name& cmdPrefix, const std::string& reason) {
         BOOST_FAIL("Command prefix registration error: " << reason);
       });
-    watchHandle.listen(cmdPrefix);
   }
 
   void
@@ -99,12 +98,12 @@
   auto data = make_shared<Data>(Name(interest.getName())
                                 .appendNumber(ndn::random::generateWord64() + 100));
   data->setContent(content, sizeof(content));
-  data->setFreshnessPeriod(milliseconds(0));
+  data->setFreshnessPeriod(0_ms);
   keyChain.sign(*data);
   watchFace.put(*data);
 
   // schedule an event 50ms later to check whether watch is Ok
-  scheduler.scheduleEvent(milliseconds(10000),
+  scheduler.scheduleEvent(10000_ms,
                           bind(&Fixture<T>::checkWatchOk, this,
                                Interest(data->getName())));
 }
@@ -128,7 +127,7 @@
   RepoCommandResponse response;
   response.wireDecode(data.getContent().blockFromValue());
 
-  int statusCode = response.getStatusCode();
+  int statusCode = response.getCode();
   BOOST_CHECK_EQUAL(statusCode, 100);
 }
 
@@ -138,7 +137,7 @@
   RepoCommandResponse response;
   response.wireDecode(data.getContent().blockFromValue());
 
-  int statusCode = response.getStatusCode();
+  int statusCode = response.getCode();
   BOOST_CHECK_EQUAL(statusCode, 101);
 }
 
@@ -187,13 +186,13 @@
   RepoCommandParameter watchParameter;
   watchParameter.setName(Name("/a/b"));
   watchParameter.setMaxInterestNum(10);
-  watchParameter.setInterestLifetime(milliseconds(50000));
-  watchParameter.setWatchTimeout(milliseconds(1000000000));
+  watchParameter.setInterestLifetime(50000_ms);
+  watchParameter.setWatchTimeout(1000000000_ms);
   watchCommandName.append(watchParameter.wireEncode());
   Interest watchInterest(watchCommandName);
   keyChain.sign(watchInterest);
   //schedule a job to express watchInterest
-  scheduler.scheduleEvent(milliseconds(1000),
+  scheduler.scheduleEvent(1000_ms,
                           bind(&Fixture<T>::sendWatchStartInterest, this, watchInterest));
 
   Name watchStopName("/repo/command/watch/stop");
@@ -202,8 +201,6 @@
   Interest watchStopInterest(watchStopName);
   keyChain.sign(watchStopInterest);
 
- // scheduler.scheduleEvent(milliseconds(10000),
-  //                        bind(&Fixture<T>::sendWatchStopInterest, this, watchStopInterest));
   //The delayEvent will be canceled in onWatchInterest
   watchFace.setInterestFilter(watchParameter.getName(),
                               bind(&Fixture<T>::onWatchInterest, this, _2),
@@ -211,15 +208,15 @@
                               bind(&Fixture<T>::onRegisterFailed, this, _2));
 }
 
-typedef boost::mpl::vector< BasicDataset > Dataset;
+typedef boost::mpl::vector<BasicDataset> Dataset;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(WatchDelete, T, Dataset, Fixture<T>)
 {
   // schedule events
-  this->scheduler.scheduleEvent(seconds(0),
+  this->scheduler.scheduleEvent(1_s,
                                 bind(&Fixture<T>::scheduleWatchEvent, this));
 
-  this->repoFace.processEvents(seconds(500));
+  this->repoFace.processEvents(500_s);
 }
 
 BOOST_AUTO_TEST_SUITE_END()
diff --git a/tests/integrated/test-basic-interest-read.cpp b/tests/integrated/test-basic-interest-read.cpp
index 8028894..0ad2f3c 100644
--- a/tests/integrated/test-basic-interest-read.cpp
+++ b/tests/integrated/test-basic-interest-read.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017, Regents of the University of California.
+ * Copyright (c) 2014-2018, Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -27,6 +27,8 @@
 #include <boost/asio/io_service.hpp>
 #include <boost/test/unit_test.hpp>
 
+#include <ndn-cxx/util/time.hpp>
+
 namespace repo {
 namespace tests {
 
@@ -41,7 +43,7 @@
 public:
   BasicInterestReadFixture()
     : scheduler(repoFace.getIoService())
-    , readHandle(repoFace, *handle, keyChain, scheduler, 0)
+    , readHandle(repoFace, *handle, 0)
     , readFace(repoFace.getIoService())
   {
   }
@@ -65,7 +67,7 @@
          i != this->data.end(); ++i) {
       //First insert a data into database;
       (*i)->setContent(content, sizeof(content));
-      (*i)->setFreshnessPeriod(ndn::time::milliseconds(36000));
+      (*i)->setFreshnessPeriod(36000_ms);
       keyChain.sign(**i);
       bool rc = handle->insertData(**i);
 
@@ -93,11 +95,17 @@
   }
 
   void
+  onReadNack(const ndn::Interest& interest, const ndn::lp::Nack& nack)
+  {
+    BOOST_ERROR("Read nacked");
+  }
+
+  void
   sendInterest(const ndn::Interest& interest)
   {
     readFace.expressInterest(interest,
                              bind(&BasicInterestReadFixture::onReadData, this, _1, _2),
-                             bind(&BasicInterestReadFixture::onReadTimeout, this, _1), // Nack
+                             bind(&BasicInterestReadFixture::onReadNack, this, _1, _2),
                              bind(&BasicInterestReadFixture::onReadTimeout, this, _1));
   }
 
@@ -109,28 +117,19 @@
   ndn::Face readFace;
 };
 
-
-typedef boost::mpl::vector< BasicDataset,
+typedef boost::mpl::vector<BasicDataset,
                             FetchByPrefixDataset,
                             BasicChildSelectorDataset,
                             ExtendedChildSelectorDataset,
-                            SamePrefixDataset<10> > Datasets;
+                            SamePrefixDataset<10>> Datasets;
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(Read, T, Datasets, BasicInterestReadFixture<T>)
 {
-  // Insert dataset
-  // for (typename T::DataContainer::iterator i = this->data.begin();
-  //      i != this->data.end(); ++i) {
-  //   BOOST_CHECK_EQUAL(this->handle.insertData(**i), true);
-  // }
-
-  // BOOST_CHECK_EQUAL(this->handle.size(), this->data.size());
-
   this->startListen();
-  this->scheduler.scheduleEvent(ndn::time::seconds(0),
+  this->scheduler.scheduleEvent(1_s,
                                 bind(&BasicInterestReadFixture<T>::scheduleReadEvent, this));
 
-  this->repoFace.processEvents(ndn::time::seconds(20));
+  this->repoFace.processEvents(20_s);
 
 }
 
diff --git a/tests/unit/read-handle.t.cpp b/tests/unit/read-handle.t.cpp
index cb9d233..9afc325 100644
--- a/tests/unit/read-handle.t.cpp
+++ b/tests/unit/read-handle.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2017,  Regents of the University of California.
+ * Copyright (c) 2014-2018,  Regents of the University of California.
  *
  * This file is part of NDN repo-ng (Next generation of NDN repository).
  * See AUTHORS.md for complete list of repo-ng authors and contributors.
@@ -53,7 +53,7 @@
     , subsetLength(1)
     , dataPrefix("/ndn/test/prefix")
     , identity("/ndn/test/identity")
-    , readHandle(face, *handle, keyChain, scheduler, subsetLength)
+    , readHandle(face, *handle, subsetLength)
     , numPrefixRegistrations(0)
     , numPrefixUnregistrations(0)
   {
@@ -103,32 +103,32 @@
   bool didMatch = false;
   face.sentInterests.clear();
   handle->insertData(*data1);
-  face.processEvents(ndn::time::milliseconds(-1));
+  face.processEvents(-1_ms);
   CHECK_INTERESTS(interest.getName(), name::Component{"register"}, true);
 
   face.sentInterests.clear();
   handle->deleteData(data1->getFullName());
-  face.processEvents(ndn::time::milliseconds(-1));
+  face.processEvents(-1_ms);
   CHECK_INTERESTS(interest.getName(), name::Component{"unregister"}, true);
 
   face.sentInterests.clear();
   handle->insertData(*data1);
-  face.processEvents(ndn::time::milliseconds(-1));
+  face.processEvents(-1_ms);
   CHECK_INTERESTS(interest.getName(), name::Component{"register"}, true);
 
   face.sentInterests.clear();
   handle->insertData(*data2);
-  face.processEvents(ndn::time::milliseconds(-1));
+  face.processEvents(-1_ms);
   CHECK_INTERESTS(interest.getName(), name::Component{"register"}, false);
 
   face.sentInterests.clear();
   handle->deleteData(data1->getFullName());
-  face.processEvents(ndn::time::milliseconds(-1));
+  face.processEvents(-1_ms);
   CHECK_INTERESTS(interest.getName(), name::Component{"unregister"}, false);
 
   face.sentInterests.clear();
   handle->deleteData(data2->getFullName());
-  face.processEvents(ndn::time::milliseconds(-1));
+  face.processEvents(-1_ms);
   CHECK_INTERESTS(interest.getName(), name::Component{"unregister"}, true);
 }
 
diff --git a/tests/unit/repo-command-response.cpp b/tests/unit/repo-command-response.cpp
index ab03207..7686c50 100644
--- a/tests/unit/repo-command-response.cpp
+++ b/tests/unit/repo-command-response.cpp
@@ -29,7 +29,7 @@
 BOOST_AUTO_TEST_CASE(EncodeDecode)
 {
   repo::RepoCommandResponse response;
-  response.setStatusCode(404);
+  response.setCode(404);
   response.setStartBlockId(1);
   response.setEndBlockId(100);
   response.setProcessId(1234567890);
@@ -53,7 +53,7 @@
                                   wire.begin(), wire.end());
 
   repo::RepoCommandResponse decoded(wire);
-  BOOST_CHECK_EQUAL(decoded.getStatusCode(), response.getStatusCode());
+  BOOST_CHECK_EQUAL(decoded.getCode(), response.getCode());
   BOOST_CHECK_EQUAL(decoded.getStartBlockId(), response.getStartBlockId());
   BOOST_CHECK_EQUAL(decoded.getEndBlockId(), response.getEndBlockId());
   BOOST_CHECK_EQUAL(decoded.getProcessId(), response.getProcessId());
