diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index 5f55451..fc24ccd 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
 
 #include "mgmt/command-authenticator.hpp"
 
-#include "tests/test-common.hpp"
-#include "tests/manager-common-fixture.hpp"
+#include "manager-common-fixture.hpp"
 
 #include <boost/filesystem.hpp>
 
diff --git a/tests/daemon/mgmt/cs-manager.t.cpp b/tests/daemon/mgmt/cs-manager.t.cpp
index 1a485725..50c82b9 100644
--- a/tests/daemon/mgmt/cs-manager.t.cpp
+++ b/tests/daemon/mgmt/cs-manager.t.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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -25,14 +25,14 @@
 
 #include "mgmt/cs-manager.hpp"
 
-#include "nfd-manager-common-fixture.hpp"
+#include "manager-common-fixture.hpp"
 
 #include <ndn-cxx/mgmt/nfd/cs-info.hpp>
 
 namespace nfd {
 namespace tests {
 
-class CsManagerFixture : public NfdManagerCommonFixture
+class CsManagerFixture : public ManagerFixtureWithAuthenticator
 {
 public:
   CsManagerFixture()
diff --git a/tests/daemon/mgmt/face-manager-command-fixture.hpp b/tests/daemon/mgmt/face-manager-command-fixture.hpp
index b00b9cc..5864ad2 100644
--- a/tests/daemon/mgmt/face-manager-command-fixture.hpp
+++ b/tests/daemon/mgmt/face-manager-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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -29,7 +29,7 @@
 #include "mgmt/face-manager.hpp"
 #include "fw/face-table.hpp"
 
-#include "tests/manager-common-fixture.hpp"
+#include "manager-common-fixture.hpp"
 
 namespace nfd {
 namespace tests {
@@ -50,7 +50,7 @@
 
 public:
   ndn::util::DummyClientFace face;
-  ndn::mgmt::Dispatcher dispatcher;
+  Dispatcher dispatcher;
   shared_ptr<CommandAuthenticator> authenticator;
 
   FaceTable faceTable;
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index 41c68c2..ac42dc9 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -29,7 +29,6 @@
 #include "mgmt/face-manager.hpp"
 #include "face/generic-link-service.hpp"
 #include "face-manager-command-fixture.hpp"
-#include "nfd-manager-common-fixture.hpp"
 
 namespace nfd {
 namespace tests {
diff --git a/tests/daemon/mgmt/face-manager-update-face.t.cpp b/tests/daemon/mgmt/face-manager-update-face.t.cpp
index 15bf6dd..1be0647 100644
--- a/tests/daemon/mgmt/face-manager-update-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-update-face.t.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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -26,7 +26,6 @@
 #include "mgmt/face-manager.hpp"
 #include "face/generic-link-service.hpp"
 #include "face-manager-command-fixture.hpp"
-#include "nfd-manager-common-fixture.hpp"
 
 #include <ndn-cxx/lp/tags.hpp>
 
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index cebbfd4..8a418e5 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -26,9 +26,9 @@
 #include "mgmt/face-manager.hpp"
 #include "face/protocol-factory.hpp"
 
-#include "nfd-manager-common-fixture.hpp"
-#include "../face/dummy-face.hpp"
-#include "../face/dummy-transport.hpp"
+#include "manager-common-fixture.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
+#include "tests/daemon/face/dummy-transport.hpp"
 
 #include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/encoding/tlv-nfd.hpp>
@@ -42,7 +42,7 @@
 namespace nfd {
 namespace tests {
 
-class FaceManagerFixture : public NfdManagerCommonFixture
+class FaceManagerFixture : public ManagerFixtureWithAuthenticator
 {
 public:
   FaceManagerFixture()
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 5fd193d..1002e44 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -26,8 +26,8 @@
 #include "mgmt/fib-manager.hpp"
 #include "table/fib-nexthop.hpp"
 
-#include "nfd-manager-common-fixture.hpp"
-#include "../face/dummy-face.hpp"
+#include "manager-common-fixture.hpp"
+#include "tests/daemon/face/dummy-face.hpp"
 
 #include <ndn-cxx/lp/tags.hpp>
 #include <ndn-cxx/mgmt/nfd/fib-entry.hpp>
@@ -35,7 +35,7 @@
 namespace nfd {
 namespace tests {
 
-class FibManagerFixture : public NfdManagerCommonFixture
+class FibManagerFixture : public ManagerFixtureWithAuthenticator
 {
 public:
   FibManagerFixture()
diff --git a/tests/daemon/mgmt/forwarder-status-manager.t.cpp b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
index 3df77ec..bb728f2 100644
--- a/tests/daemon/mgmt/forwarder-status-manager.t.cpp
+++ b/tests/daemon/mgmt/forwarder-status-manager.t.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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -26,24 +26,25 @@
 #include "mgmt/forwarder-status-manager.hpp"
 #include "core/version.hpp"
 
-#include "nfd-manager-common-fixture.hpp"
+#include "manager-common-fixture.hpp"
 
 namespace nfd {
 namespace tests {
 
-class ForwarderStatusManagerFixture : public NfdManagerCommonFixture
+class ForwarderStatusManagerFixture : public ManagerCommonFixture
 {
 protected:
   ForwarderStatusManagerFixture()
-    : manager(m_forwarder, m_dispatcher)
-    , startTime(time::system_clock::now())
+    : m_manager(m_forwarder, m_dispatcher)
+    , m_startTime(time::system_clock::now())
   {
     setTopPrefix();
   }
 
 protected:
-  ForwarderStatusManager manager;
-  time::system_clock::TimePoint startTime;
+  Forwarder m_forwarder;
+  ForwarderStatusManager m_manager;
+  time::system_clock::TimePoint m_startTime;
 };
 
 BOOST_AUTO_TEST_SUITE(Mgmt)
@@ -78,11 +79,9 @@
   BOOST_CHECK_EQUAL(m_forwarder.getCounters().nUnsatisfiedInterests, 1);
 
   // request
-  time::system_clock::TimePoint beforeRequest = time::system_clock::now();
-  Interest request("/localhost/nfd/status/general");
-  request.setMustBeFresh(true).setChildSelector(1);
-  this->receiveInterest(request);
-  time::system_clock::TimePoint afterRequest = time::system_clock::now();
+  auto beforeRequest = time::system_clock::now();
+  receiveInterest(Interest("/localhost/nfd/status/general").setCanBePrefix(true));
+  auto afterRequest = time::system_clock::now();
 
   // verify
   Block response = this->concatenateResponses(0, m_responses.size());
@@ -90,7 +89,7 @@
   BOOST_REQUIRE_NO_THROW(status.wireDecode(response));
 
   BOOST_CHECK_EQUAL(status.getNfdVersion(), NFD_VERSION_BUILD_STRING);
-  BOOST_CHECK_EQUAL(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(startTime));
+  BOOST_CHECK_EQUAL(time::toUnixTimestamp(status.getStartTimestamp()), time::toUnixTimestamp(m_startTime));
   BOOST_CHECK_GE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(beforeRequest));
   BOOST_CHECK_LE(time::toUnixTimestamp(status.getCurrentTimestamp()), time::toUnixTimestamp(afterRequest));
 
diff --git a/tests/daemon/mgmt/manager-base.t.cpp b/tests/daemon/mgmt/manager-base.t.cpp
new file mode 100644
index 0000000..3aeeb9e
--- /dev/null
+++ b/tests/daemon/mgmt/manager-base.t.cpp
@@ -0,0 +1,172 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2019,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "mgmt/manager-base.hpp"
+
+#include "manager-common-fixture.hpp"
+
+#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/pib/identity.hpp>
+#include <ndn-cxx/security/pib/key.hpp>
+#include <ndn-cxx/security/pib/pib.hpp>
+
+namespace nfd {
+namespace tests {
+
+class TestCommandVoidParameters : public ControlCommand
+{
+public:
+  TestCommandVoidParameters()
+    : ControlCommand("test-module", "test-void-parameters")
+  {
+  }
+};
+
+class TestCommandRequireName : public ControlCommand
+{
+public:
+  TestCommandRequireName()
+    : ControlCommand("test-module", "test-require-name")
+  {
+    m_requestValidator.required(ndn::nfd::CONTROL_PARAMETER_NAME);
+  }
+};
+
+class DummyManager : public ManagerBase
+{
+public:
+  explicit
+  DummyManager(Dispatcher& dispatcher)
+    : ManagerBase("test-module", dispatcher)
+  {
+  }
+
+private:
+  ndn::mgmt::Authorization
+  makeAuthorization(const std::string& verb) override
+  {
+    return [] (const Name& prefix, const Interest& interest,
+               const ndn::mgmt::ControlParameters* params,
+               ndn::mgmt::AcceptContinuation accept,
+               ndn::mgmt::RejectContinuation reject) {
+      accept("requester");
+    };
+  }
+};
+
+class ManagerBaseFixture : public ManagerCommonFixture
+{
+protected:
+  DummyManager m_manager{m_dispatcher};
+};
+
+BOOST_AUTO_TEST_SUITE(Mgmt)
+BOOST_FIXTURE_TEST_SUITE(TestManagerBase, ManagerBaseFixture)
+
+BOOST_AUTO_TEST_CASE(RegisterCommandHandler)
+{
+  bool wasCommandHandlerCalled = false;
+  auto handler = bind([&] { wasCommandHandlerCalled = true; });
+
+  m_manager.registerCommandHandler<TestCommandVoidParameters>("test-void", handler);
+  m_manager.registerCommandHandler<TestCommandRequireName>("test-require-name", handler);
+  setTopPrefix();
+
+  auto testRegisterCommandHandler = [&wasCommandHandlerCalled, this] (const Name& commandName) {
+    wasCommandHandlerCalled = false;
+    receiveInterest(makeControlCommandRequest(commandName, ControlParameters()));
+  };
+
+  testRegisterCommandHandler("/localhost/nfd/test-module/test-void");
+  BOOST_CHECK(wasCommandHandlerCalled);
+
+  testRegisterCommandHandler("/localhost/nfd/test-module/test-require-name");
+  BOOST_CHECK(!wasCommandHandlerCalled);
+}
+
+BOOST_AUTO_TEST_CASE(RegisterStatusDataset)
+{
+  bool isStatusDatasetCalled = false;
+  auto handler = bind([&] { isStatusDatasetCalled = true; });
+
+  m_manager.registerStatusDatasetHandler("test-status", handler);
+  setTopPrefix();
+
+  receiveInterest(Interest("/localhost/nfd/test-module/test-status"));
+  BOOST_CHECK(isStatusDatasetCalled);
+}
+
+BOOST_AUTO_TEST_CASE(RegisterNotificationStream)
+{
+  auto post = m_manager.registerNotificationStream("test-notification");
+  setTopPrefix();
+
+  const uint8_t buf[] = {0x82, 0x01, 0x02};
+  post(Block(buf, sizeof(buf)));
+  advanceClocks(time::milliseconds(1));
+
+  BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
+  BOOST_CHECK_EQUAL(m_responses[0].getName(),
+                    Name("/localhost/nfd/test-module/test-notification/%FE%00"));
+}
+
+BOOST_AUTO_TEST_CASE(ExtractRequester)
+{
+  std::string requesterName;
+  auto testAccept = [&] (const std::string& requester) { requesterName = requester; };
+
+  m_manager.extractRequester(Interest("/test/interest/unsigned"), testAccept);
+  BOOST_CHECK(requesterName.empty());
+
+  requesterName = "";
+  m_manager.extractRequester(makeControlCommandRequest("/test/interest/signed", ControlParameters()), testAccept);
+  auto keyLocator = m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY).getDefaultKey().getName();
+  BOOST_CHECK_EQUAL(requesterName, keyLocator.toUri());
+}
+
+BOOST_AUTO_TEST_CASE(ValidateParameters)
+{
+  ControlParameters params;
+  TestCommandVoidParameters commandVoidParams;
+  TestCommandRequireName commandRequireName;
+
+  BOOST_CHECK_EQUAL(ManagerBase::validateParameters(commandVoidParams, params), true); // succeeds
+  BOOST_CHECK_EQUAL(ManagerBase::validateParameters(commandRequireName, params), false); // fails
+
+  params.setName("test-name");
+  BOOST_CHECK_EQUAL(ManagerBase::validateParameters(commandRequireName, params), true); // succeeds
+}
+
+BOOST_AUTO_TEST_CASE(MakeRelPrefix)
+{
+  auto generatedRelPrefix = m_manager.makeRelPrefix("test-verb");
+  BOOST_CHECK_EQUAL(generatedRelPrefix, PartialName("/test-module/test-verb"));
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestManagerBase
+BOOST_AUTO_TEST_SUITE_END() // Mgmt
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/manager-common-fixture.cpp b/tests/daemon/mgmt/manager-common-fixture.cpp
new file mode 100644
index 0000000..ee8d543
--- /dev/null
+++ b/tests/daemon/mgmt/manager-common-fixture.cpp
@@ -0,0 +1,221 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2019,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "manager-common-fixture.hpp"
+
+#include <ndn-cxx/security/signing-helpers.hpp>
+
+namespace nfd {
+namespace tests {
+
+const Name CommandInterestSignerFixture::DEFAULT_COMMAND_SIGNER_IDENTITY("/CommandInterestSignerFixture-identity");
+
+CommandInterestSignerFixture::CommandInterestSignerFixture()
+  : m_commandInterestSigner(m_keyChain)
+{
+  BOOST_REQUIRE(this->addIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY));
+}
+
+Interest
+CommandInterestSignerFixture::makeCommandInterest(const Name& name, const Name& identity)
+{
+  return m_commandInterestSigner.makeCommandInterest(name, ndn::security::signingByIdentity(identity));
+}
+
+Interest
+CommandInterestSignerFixture::makeControlCommandRequest(Name commandName,
+                                                        const ControlParameters& params,
+                                                        const Name& identity)
+{
+  commandName.append(params.wireEncode());
+  return this->makeCommandInterest(commandName, identity);
+}
+
+ManagerCommonFixture::ManagerCommonFixture()
+  : m_face(getGlobalIoService(), m_keyChain, {true, true})
+  , m_dispatcher(m_face, m_keyChain, ndn::security::SigningInfo())
+  , m_responses(m_face.sentData)
+{
+}
+
+void
+ManagerCommonFixture::setTopPrefix()
+{
+  m_dispatcher.addTopPrefix("/localhost/nfd");
+  advanceClocks(1_ms); // so that all filters are added
+}
+
+void
+ManagerCommonFixture::receiveInterest(const Interest& interest)
+{
+  m_face.receive(interest);
+  advanceClocks(1_ms);
+}
+
+ControlResponse
+ManagerCommonFixture::makeResponse(uint32_t code, const std::string& text,
+                                   const ControlParameters& parameters)
+{
+  return ControlResponse(code, text).setBody(parameters.wireEncode());
+}
+
+ManagerCommonFixture::CheckResponseResult
+ManagerCommonFixture::checkResponse(size_t idx,
+                                    const Name& expectedName,
+                                    const ControlResponse& expectedResponse,
+                                    int expectedContentType /*= -1*/)
+{
+  Data data;
+  try {
+    data = m_responses.at(idx);
+  }
+  catch (const std::out_of_range&) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] does not exist");
+    return CheckResponseResult::OUT_OF_BOUNDARY;
+  }
+
+  if (data.getName() != expectedName) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] has wrong name " << data.getName());
+    return CheckResponseResult::WRONG_NAME;
+  }
+
+  if (expectedContentType != -1 &&
+      data.getContentType() != static_cast<uint32_t>(expectedContentType)) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] has wrong ContentType " << data.getContentType());
+    return CheckResponseResult::WRONG_CONTENT_TYPE;
+  }
+
+  ControlResponse response;
+  try {
+    response.wireDecode(data.getContent().blockFromValue());
+  }
+  catch (const tlv::Error&) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] cannot be decoded");
+    return CheckResponseResult::INVALID_RESPONSE;
+  }
+
+  if (response.getCode() != expectedResponse.getCode()) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] has wrong StatusCode " << response.getCode());
+    return CheckResponseResult::WRONG_CODE;
+  }
+
+  if (response.getText() != expectedResponse.getText()) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] has wrong StatusText " << response.getText());
+    return CheckResponseResult::WRONG_TEXT;
+  }
+
+  const Block& body = response.getBody();
+  const Block& expectedBody = expectedResponse.getBody();
+  if (body.value_size() != expectedBody.value_size()) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] has wrong body size " << body.value_size());
+    return CheckResponseResult::WRONG_BODY_SIZE;
+  }
+  if (body.value_size() > 0 && memcmp(body.value(), expectedBody.value(), body.value_size()) != 0) {
+    BOOST_TEST_MESSAGE("response[" << idx << "] has wrong body value");
+    return CheckResponseResult::WRONG_BODY_VALUE;
+  }
+
+  return CheckResponseResult::OK;
+}
+
+Block
+ManagerCommonFixture::concatenateResponses(size_t startIndex, size_t nResponses)
+{
+  while (m_responses.back().getName().at(-1) != m_responses.back().getFinalBlock()) {
+    const Name& name = m_responses.back().getName();
+    Name prefix = name.getPrefix(-1);
+    uint64_t segmentNo = name.at(-1).toSegment() + 1;
+    // request for the next segment
+    receiveInterest(Interest(prefix.appendSegment(segmentNo)));
+  }
+
+  size_t endIndex = startIndex + nResponses; // not included
+  if (nResponses == startIndex || endIndex > m_responses.size()) {
+    endIndex = m_responses.size();
+  }
+
+  ndn::EncodingBuffer encoder;
+  size_t valueLength = 0;
+  for (size_t i = startIndex; i < endIndex ; i ++) {
+    valueLength += encoder.appendByteArray(m_responses[i].getContent().value(),
+                                           m_responses[i].getContent().value_size());
+  }
+  encoder.prependVarNumber(valueLength);
+  encoder.prependVarNumber(tlv::Content);
+  return encoder.block();
+}
+
+std::ostream&
+operator<<(std::ostream& os, ManagerCommonFixture::CheckResponseResult result)
+{
+  switch (result) {
+    case ManagerCommonFixture::CheckResponseResult::OK:
+      return os << "OK";
+    case ManagerCommonFixture::CheckResponseResult::OUT_OF_BOUNDARY:
+      return os << "OUT_OF_BOUNDARY";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_NAME:
+      return os << "WRONG_NAME";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_CONTENT_TYPE:
+      return os << "WRONG_CONTENT_TYPE";
+    case ManagerCommonFixture::CheckResponseResult::INVALID_RESPONSE:
+      return os << "INVALID_RESPONSE";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_CODE:
+      return os << "WRONG_CODE";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_TEXT:
+      return os << "WRONG_TEXT";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_BODY_SIZE:
+      return os << "WRONG_BODY_SIZE";
+    case ManagerCommonFixture::CheckResponseResult::WRONG_BODY_VALUE:
+      return os << "WRONG_BODY_VALUE";
+  }
+  return os << static_cast<int>(result);
+}
+
+void
+ManagerFixtureWithAuthenticator::setPrivilege(const std::string& privilege)
+{
+  saveIdentityCertificate(DEFAULT_COMMAND_SIGNER_IDENTITY, "ManagerCommonFixture.ndncert");
+
+  const std::string& config = R"CONFIG(
+    authorizations
+    {
+      authorize
+      {
+        certfile "ManagerCommonFixture.ndncert"
+        privileges
+        {
+          )CONFIG" + privilege + R"CONFIG(
+        }
+      }
+    }
+  )CONFIG";
+
+  ConfigFile cf;
+  m_authenticator->setConfigFile(cf);
+  cf.parse(config, false, "ManagerCommonFixture.authenticator.conf");
+}
+
+} // namespace tests
+} // namespace nfd
diff --git a/tests/daemon/mgmt/manager-common-fixture.hpp b/tests/daemon/mgmt/manager-common-fixture.hpp
new file mode 100644
index 0000000..8725680
--- /dev/null
+++ b/tests/daemon/mgmt/manager-common-fixture.hpp
@@ -0,0 +1,204 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2014-2019,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD 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.
+ *
+ * NFD 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
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_TESTS_DAEMON_MGMT_MANAGER_COMMON_FIXTURE_HPP
+#define NFD_TESTS_DAEMON_MGMT_MANAGER_COMMON_FIXTURE_HPP
+
+#include "mgmt/manager-base.hpp"
+#include "fw/forwarder.hpp"
+
+#include "tests/identity-management-fixture.hpp"
+
+#include <ndn-cxx/security/command-interest-signer.hpp>
+#include <ndn-cxx/util/dummy-client-face.hpp>
+
+namespace nfd {
+namespace tests {
+
+/** \brief A fixture that provides a CommandInterestSigner.
+ */
+class CommandInterestSignerFixture : public IdentityManagementTimeFixture
+{
+protected:
+  CommandInterestSignerFixture();
+
+  /** \brief sign a command Interest
+   *  \param name command name include prefix and parameters
+   *  \param identity signing identity
+   *  \return a command Interest
+   */
+  Interest
+  makeCommandInterest(const Name& name, const Name& identity = DEFAULT_COMMAND_SIGNER_IDENTITY);
+
+  /** \brief create a ControlCommand request
+   *  \param commandName command name including prefix, such as "/localhost/nfd/fib/add-nexthop"
+   *  \param params command parameters
+   *  \param identity signing identity
+   *  \return a command Interest
+   */
+  Interest
+  makeControlCommandRequest(Name commandName, const ControlParameters& params,
+                            const Name& identity = DEFAULT_COMMAND_SIGNER_IDENTITY);
+
+protected:
+  static const Name DEFAULT_COMMAND_SIGNER_IDENTITY;
+
+private:
+  ndn::security::CommandInterestSigner m_commandInterestSigner;
+};
+
+/**
+ * @brief A collection of common functions shared by all manager's test fixtures.
+ */
+class ManagerCommonFixture : public CommandInterestSignerFixture
+{
+public: // initialize
+  ManagerCommonFixture();
+
+  /**
+   * @brief Add `/localhost/nfd` as a top prefix to the dispatcher.
+   *
+   * Afterwards, advanceClocks() is called to ensure all added filters take effect.
+   */
+  void
+  setTopPrefix();
+
+public: // test
+  /**
+   * @brief cause management to receive an Interest
+   *
+   * call DummyClientFace::receive to receive Interest and then call advanceClocks to ensure
+   * the Interest dispatched
+   *
+   * @param interest the Interest to receive
+   */
+  void
+  receiveInterest(const Interest& interest);
+
+public: // verify
+  ControlResponse
+  makeResponse(uint32_t code, const std::string& text, const ControlParameters& parameters);
+
+  enum class CheckResponseResult
+  {
+    OK,
+    OUT_OF_BOUNDARY,
+    WRONG_NAME,
+    WRONG_CONTENT_TYPE,
+    INVALID_RESPONSE,
+    WRONG_CODE,
+    WRONG_TEXT,
+    WRONG_BODY_SIZE,
+    WRONG_BODY_VALUE
+  };
+
+  /**
+   * @brief check a specified response data with the expected ControlResponse
+   *
+   * @param idx the index of the specified Data in m_responses
+   * @param expectedDataName the expected name of this Data
+   * @param expectedResponse the expected ControlResponse
+   * @param expectedContentType the expected content type of this Data, use -1 to skip this check
+   *
+   * @retval OK the response at the specified index can be decoded from the response data,
+   *            and its code, text and response body are all matched with the expected response
+   * @retval OUT_OF_BOUNDARY the specified index out of boundary
+   * @retval WRONG_NAME the name of the specified response data does not match
+   * @retval WRONG_CONTENT_TYPE the content type of the specified response data does not match
+   * @retval INVALID_RESPONSE the data name matches but it fails in decoding a ControlResponse from
+   *                          the content of the specified response data
+   * @retval WRONG_CODE a valid ControlResponse can be decoded but has a wrong code
+   * @retval WRONG_TEXT a valid ControlResponse can be decoded but has a wrong text
+   * @retval WRONG_BODY_SIZE the body size of decoded ControlResponse does not match
+   * @retval WRONT_BODY_VALUE the body value of decoded ControlResponse does not match
+   */
+  CheckResponseResult
+  checkResponse(size_t idx,
+                const Name& expectedName,
+                const ControlResponse& expectedResponse,
+                int expectedContentType = -1);
+
+  /**
+   * @brief concatenate specified response Data into a single block
+   *
+   * @param startIndex the start index in m_responses
+   * @param nResponses the number of response to concatenate
+   *
+   * @return the generated block
+   */
+  Block
+  concatenateResponses(size_t startIndex = 0, size_t nResponses = 0);
+
+protected:
+  ndn::util::DummyClientFace m_face;
+  Dispatcher m_dispatcher;
+  std::vector<Data>& m_responses; ///< a reference to m_face.sentData
+};
+
+std::ostream&
+operator<<(std::ostream& os, ManagerCommonFixture::CheckResponseResult result);
+
+class ManagerFixtureWithAuthenticator : public ManagerCommonFixture
+{
+public:
+  /** \brief grant m_identityName privilege to sign commands for the management module
+   */
+  void
+  setPrivilege(const std::string& privilege);
+
+protected:
+  Forwarder m_forwarder;
+  shared_ptr<CommandAuthenticator> m_authenticator = CommandAuthenticator::create();
+};
+
+class CommandSuccess
+{
+public:
+  static ControlResponse
+  getExpected()
+  {
+    return ControlResponse()
+        .setCode(200)
+        .setText("OK");
+  }
+};
+
+template<int CODE>
+class CommandFailure
+{
+public:
+  static ControlResponse
+  getExpected()
+  {
+    return ControlResponse()
+        .setCode(CODE);
+    // error description should not be checked
+  }
+};
+
+} // namespace tests
+} // namespace nfd
+
+#endif // NFD_TESTS_DAEMON_MGMT_MANAGER_COMMON_FIXTURE_HPP
diff --git a/tests/daemon/mgmt/nfd-manager-common-fixture.cpp b/tests/daemon/mgmt/nfd-manager-common-fixture.cpp
deleted file mode 100644
index f39e983..0000000
--- a/tests/daemon/mgmt/nfd-manager-common-fixture.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "nfd-manager-common-fixture.hpp"
-
-namespace nfd {
-namespace tests {
-
-NfdManagerCommonFixture::NfdManagerCommonFixture()
-  : m_authenticator(CommandAuthenticator::create())
-{
-}
-
-void
-NfdManagerCommonFixture::setTopPrefix()
-{
-  this->ManagerCommonFixture::setTopPrefix("/localhost/nfd");
-}
-
-void
-NfdManagerCommonFixture::setPrivilege(const std::string& privilege)
-{
-  this->saveIdentityCertificate(DEFAULT_COMMAND_SIGNER_IDENTITY, "ManagerCommonFixture.ndncert");
-
-  const std::string& config = R"CONFIG(
-    authorizations
-    {
-      authorize
-      {
-        certfile "ManagerCommonFixture.ndncert"
-        privileges
-        {
-          )CONFIG" + privilege + R"CONFIG(
-        }
-      }
-    }
-  )CONFIG";
-
-  ConfigFile cf;
-  m_authenticator->setConfigFile(cf);
-  cf.parse(config, false, "ManagerCommonFixture.authenticator.conf");
-}
-
-} // namespace tests
-} // namespace nfd
diff --git a/tests/daemon/mgmt/nfd-manager-common-fixture.hpp b/tests/daemon/mgmt/nfd-manager-common-fixture.hpp
deleted file mode 100644
index fb2dbc2..0000000
--- a/tests/daemon/mgmt/nfd-manager-common-fixture.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
- *                           Arizona Board of Regents,
- *                           Colorado State University,
- *                           University Pierre & Marie Curie, Sorbonne University,
- *                           Washington University in St. Louis,
- *                           Beijing Institute of Technology,
- *                           The University of Memphis.
- *
- * This file is part of NFD (Named Data Networking Forwarding Daemon).
- * See AUTHORS.md for complete list of NFD authors and contributors.
- *
- * NFD 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.
- *
- * NFD 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
- * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NFD_TESTS_DAEMON_MGMT_NFD_MANAGER_COMMON_FIXTURE_HPP
-#define NFD_TESTS_DAEMON_MGMT_NFD_MANAGER_COMMON_FIXTURE_HPP
-
-#include "tests/manager-common-fixture.hpp"
-#include "fw/forwarder.hpp"
-#include "mgmt/command-authenticator.hpp"
-
-namespace nfd {
-namespace tests {
-
-/** \brief base fixture for testing an NFD Manager
- */
-class NfdManagerCommonFixture : public ManagerCommonFixture
-{
-public:
-  NfdManagerCommonFixture();
-
-  /** \brief add /localhost/nfd as a top prefix to the dispatcher
-   */
-  void
-  setTopPrefix();
-
-  /** \brief grant m_identityName privilege to sign commands for the management module
-   */
-  void
-  setPrivilege(const std::string& privilege);
-
-protected:
-  Forwarder m_forwarder;
-  shared_ptr<CommandAuthenticator> m_authenticator;
-};
-
-class CommandSuccess
-{
-public:
-  static ControlResponse
-  getExpected()
-  {
-    return ControlResponse()
-      .setCode(200)
-      .setText("OK");
-  }
-};
-
-template<int CODE>
-class CommandFailure
-{
-public:
-  static ControlResponse
-  getExpected()
-  {
-    return ControlResponse()
-      .setCode(CODE);
-    // error description should not be checked
-  }
-};
-
-} // namespace tests
-} // namespace nfd
-
-#endif // NFD_TESTS_DAEMON_MGMT_NFD_MANAGER_COMMON_FIXTURE_HPP
diff --git a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
index 06e3d5e..452d758 100644
--- a/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
+++ b/tests/daemon/mgmt/rib-manager-sl-announce.t.cpp
@@ -165,7 +165,7 @@
   ndn::util::DummyClientFace m_face;
   ndn::util::Scheduler m_scheduler;
   ndn::nfd::Controller m_nfdController;
-  ndn::mgmt::Dispatcher m_dispatcher;
+  Dispatcher m_dispatcher;
   rib::FibUpdater m_fibUpdater;
 
   ndn::security::SigningInfo m_trustedSigner;
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 46da6a1..c3c5dd6 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -27,7 +27,7 @@
 #include "core/fib-max-depth.hpp"
 #include "rib/fib-updater.hpp"
 
-#include "tests/manager-common-fixture.hpp"
+#include "manager-common-fixture.hpp"
 
 #include <ndn-cxx/lp/tags.hpp>
 #include <ndn-cxx/mgmt/nfd/face-status.hpp>
@@ -93,10 +93,10 @@
     advanceClocks(1_ms);
 
     auto replyFibAddCommand = [this] (const Interest& interest) {
-      nfd::ControlParameters params(interest.getName().get(-5).blockFromValue());
+      ControlParameters params(interest.getName().get(-5).blockFromValue());
       BOOST_CHECK(params.getName() == "/localhost/nfd/rib" || params.getName() == "/localhop/nfd/rib");
       params.setFaceId(1).setCost(0);
-      nfd::ControlResponse resp;
+      ControlResponse resp;
 
       resp.setCode(200).setBody(params.wireEncode());
       shared_ptr<Data> data = make_shared<Data>(interest.getName());
diff --git a/tests/daemon/mgmt/strategy-choice-manager.t.cpp b/tests/daemon/mgmt/strategy-choice-manager.t.cpp
index 817966e..6b7e390 100644
--- a/tests/daemon/mgmt/strategy-choice-manager.t.cpp
+++ b/tests/daemon/mgmt/strategy-choice-manager.t.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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -26,15 +26,15 @@
 #include "mgmt/strategy-choice-manager.hpp"
 #include "table/strategy-choice.hpp"
 
-#include "nfd-manager-common-fixture.hpp"
-#include "../fw/dummy-strategy.hpp"
+#include "manager-common-fixture.hpp"
+#include "tests/daemon/fw/dummy-strategy.hpp"
 
 #include <ndn-cxx/mgmt/nfd/strategy-choice.hpp>
 
 namespace nfd {
 namespace tests {
 
-class StrategyChoiceManagerFixture : public NfdManagerCommonFixture
+class StrategyChoiceManagerFixture : public ManagerFixtureWithAuthenticator
 {
 public:
   StrategyChoiceManagerFixture()
