diff --git a/tests/unit-tests/security/command-interest-validator.t.cpp b/tests/unit-tests/security/command-interest-validator.t.cpp
deleted file mode 100644
index e8c4eeb..0000000
--- a/tests/unit-tests/security/command-interest-validator.t.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library 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 Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- */
-
-#include "security/command-interest-validator.hpp"
-#include "security/command-interest-signer.hpp"
-#include "security/signing-helpers.hpp"
-
-#include "boost-test.hpp"
-#include "dummy-validator.hpp"
-#include "../identity-management-time-fixture.hpp"
-#include "../make-interest-data.hpp"
-
-#include <boost/lexical_cast.hpp>
-
-namespace ndn {
-namespace security {
-namespace tests {
-
-using namespace ndn::tests;
-
-class CommandInterestValidatorFixture : public IdentityManagementTimeFixture
-{
-protected:
-  CommandInterestValidatorFixture()
-    : signer(m_keyChain)
-  {
-    this->initialize(CommandInterestValidator::Options{});
-  }
-
-  void
-  initialize(const CommandInterestValidator::Options& options)
-  {
-    auto inner = make_unique<DummyValidator>();
-    this->inner = inner.get();
-    this->validator = make_unique<CommandInterestValidator>(std::move(inner), options);
-  }
-
-  Name
-  makeIdentity(uint64_t identity)
-  {
-    Name name("/localhost/CommandInterestValidatorIdentity");
-    name.appendSequenceNumber(identity);
-    this->addIdentity(name);
-    return name;
-  }
-
-  shared_ptr<Interest>
-  makeCommandInterest(uint64_t identity = 0)
-  {
-    auto interest = signer.makeCommandInterest("/CommandInterestPrefix", signingByIdentity(makeIdentity(identity)));
-    return make_shared<Interest>(std::move(interest));
-  }
-
-  /** \brief check that validator accepts interest
-   *  \param interest to be validated
-   */
-  void
-  assertAccept(const Interest& interest)
-  {
-    int nAccepts = 0;
-    validator->validate(interest,
-      [&nAccepts] (const shared_ptr<const Interest>&) { ++nAccepts; },
-      [] (const shared_ptr<const Interest>&, const std::string& msg) {
-        BOOST_ERROR("validation request should succeed but fails with: " << msg);
-      });
-    BOOST_CHECK_EQUAL(nAccepts, 1);
-  }
-
-  /** \brief check that validator rejects interest
-   *  \param interest to be validated
-   *  \param error if not NONE, further check the error code matches \p error
-   *               if NONE, error code is not checked
-   */
-  void
-  assertReject(const Interest& interest, CommandInterestValidator::ErrorCode error)
-  {
-    int nRejects = 0;
-    validator->validate(interest,
-      [] (const shared_ptr<const Interest>&) {
-        BOOST_ERROR("validation request should fail but succeeds");
-      },
-      [&nRejects, error] (const shared_ptr<const Interest>&, const std::string& msg) {
-        ++nRejects;
-        if (error != CommandInterestValidator::ErrorCode::NONE) {
-          BOOST_CHECK_EQUAL(msg, boost::lexical_cast<std::string>(error));
-        }
-      });
-    BOOST_CHECK_EQUAL(nRejects, 1);
-  }
-
-protected:
-  CommandInterestSigner signer;
-  DummyValidator* inner;
-  unique_ptr<CommandInterestValidator> validator;
-};
-
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestCommandInterestValidator, CommandInterestValidatorFixture)
-
-BOOST_AUTO_TEST_SUITE(Accepts)
-
-BOOST_AUTO_TEST_CASE(Basic)
-{
-  auto i1 = makeCommandInterest();
-  assertAccept(*i1);
-
-  advanceClocks(time::milliseconds(5));
-  auto i2 = makeCommandInterest();
-  assertAccept(*i2);
-
-  advanceClocks(time::seconds(2));
-  auto i3 = makeCommandInterest();
-  assertAccept(*i3);
-}
-
-BOOST_AUTO_TEST_CASE(DataPassthru)
-{
-  auto d1 = makeData("/data");
-  int nAccepts = 0;
-  validator->validate(*d1,
-    [&nAccepts] (const shared_ptr<const Data>&) { ++nAccepts; },
-    [] (const shared_ptr<const Data>&, const std::string& msg) {
-      BOOST_ERROR("validation request should succeed but fails with: " << msg);
-    });
-  BOOST_CHECK_EQUAL(nAccepts, 1);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // Accepts
-
-BOOST_AUTO_TEST_SUITE(Rejects)
-
-BOOST_AUTO_TEST_CASE(NameTooShort)
-{
-  auto i1 = makeInterest("/name/too/short");
-  assertReject(*i1, CommandInterestValidator::ErrorCode::NAME_TOO_SHORT);
-}
-
-BOOST_AUTO_TEST_CASE(BadTimestamp)
-{
-  auto i1 = makeCommandInterest();
-  setNameComponent(*i1, command_interest::POS_TIMESTAMP, "not-timestamp");
-  assertReject(*i1, CommandInterestValidator::ErrorCode::BAD_TIMESTAMP);
-}
-
-BOOST_AUTO_TEST_CASE(BadSigInfo)
-{
-  auto i1 = makeCommandInterest();
-  setNameComponent(*i1, signed_interest::POS_SIG_INFO, "not-SignatureInfo");
-  assertReject(*i1, CommandInterestValidator::ErrorCode::BAD_SIG_INFO);
-}
-
-BOOST_AUTO_TEST_CASE(MissingKeyLocator)
-{
-  auto i1 = makeCommandInterest();
-  SignatureInfo sigInfo;
-  setNameComponent(*i1, signed_interest::POS_SIG_INFO,
-                   sigInfo.wireEncode().begin(), sigInfo.wireEncode().end());
-  assertReject(*i1, CommandInterestValidator::ErrorCode::MISSING_KEY_LOCATOR);
-}
-
-BOOST_AUTO_TEST_CASE(BadKeyLocatorType)
-{
-  auto i1 = makeCommandInterest();
-  KeyLocator kl;
-  kl.setKeyDigest(makeBinaryBlock(tlv::KeyDigest, "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD", 8));
-  SignatureInfo sigInfo;
-  sigInfo.setKeyLocator(kl);
-  setNameComponent(*i1, signed_interest::POS_SIG_INFO,
-                   sigInfo.wireEncode().begin(), sigInfo.wireEncode().end());
-  assertReject(*i1, CommandInterestValidator::ErrorCode::BAD_KEY_LOCATOR_TYPE);
-}
-
-BOOST_AUTO_TEST_CASE(BadCertName)
-{
-  auto i1 = makeCommandInterest();
-  KeyLocator kl;
-  kl.setName("/bad/cert/name");
-  SignatureInfo sigInfo;
-  sigInfo.setKeyLocator(kl);
-  setNameComponent(*i1, signed_interest::POS_SIG_INFO,
-                   sigInfo.wireEncode().begin(), sigInfo.wireEncode().end());
-  assertReject(*i1, CommandInterestValidator::ErrorCode::BAD_CERT_NAME);
-}
-
-BOOST_AUTO_TEST_CASE(InnerReject)
-{
-  inner->setResult(false);
-  auto i1 = makeCommandInterest();
-  assertReject(*i1, CommandInterestValidator::ErrorCode::NONE);
-}
-
-BOOST_AUTO_TEST_CASE(TimestampOutOfGracePositive)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(15);
-  initialize(options);
-
-  auto i1 = makeCommandInterest(); // signed at 0s
-  advanceClocks(time::seconds(16)); // verifying at +16s
-  assertReject(*i1, CommandInterestValidator::ErrorCode::TIMESTAMP_OUT_OF_GRACE);
-
-  auto i2 = makeCommandInterest(); // signed at +16s
-  assertAccept(*i2); // verifying at +16s
-}
-
-BOOST_AUTO_TEST_CASE(TimestampOutOfGraceNegative)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(15);
-  initialize(options);
-
-  auto i1 = makeCommandInterest(); // signed at 0s
-  advanceClocks(time::seconds(1));
-  auto i2 = makeCommandInterest(); // signed at +1s
-  advanceClocks(time::seconds(1));
-  auto i3 = makeCommandInterest(); // signed at +2s
-
-  systemClock->advance(time::seconds(-18)); // verifying at -16s
-  assertReject(*i1, CommandInterestValidator::ErrorCode::TIMESTAMP_OUT_OF_GRACE);
-
-  // CommandInterestValidator should not remember i1's timestamp
-  assertReject(*i2, CommandInterestValidator::ErrorCode::TIMESTAMP_OUT_OF_GRACE);
-
-  // CommandInterestValidator should not remember i2's timestamp, and should treat i3 as initial
-  advanceClocks(time::seconds(18)); // verifying at +2s
-  assertAccept(*i3);
-}
-
-BOOST_AUTO_TEST_CASE(TimestampReorderEqual)
-{
-  auto i1 = makeCommandInterest(); // signed at 0s
-  assertAccept(*i1);
-
-  auto i2 = makeCommandInterest(); // signed at 0s
-  setNameComponent(*i2, command_interest::POS_TIMESTAMP,
-                   i1->getName()[command_interest::POS_TIMESTAMP]);
-  assertReject(*i2, CommandInterestValidator::ErrorCode::TIMESTAMP_REORDER);
-
-  advanceClocks(time::seconds(2));
-  auto i3 = makeCommandInterest(); // signed at +2s
-  assertAccept(*i3);
-}
-
-BOOST_AUTO_TEST_CASE(TimestampReorderNegative)
-{
-  auto i2 = makeCommandInterest(); // signed at 0ms
-  advanceClocks(time::milliseconds(200));
-  auto i3 = makeCommandInterest(); // signed at +200ms
-  advanceClocks(time::milliseconds(900));
-  auto i1 = makeCommandInterest(); // signed at +1100ms
-  advanceClocks(time::milliseconds(300));
-  auto i4 = makeCommandInterest(); // signed at +1400ms
-
-  systemClock->advance(time::milliseconds(-300)); // verifying at +1100ms
-  assertAccept(*i1);
-
-  systemClock->advance(time::milliseconds(-1100)); // verifying at 0ms
-  assertReject(*i2, CommandInterestValidator::ErrorCode::TIMESTAMP_REORDER);
-
-  // CommandInterestValidator should not remember i2's timestamp
-  advanceClocks(time::milliseconds(200)); // verifying at +200ms
-  assertReject(*i3, CommandInterestValidator::ErrorCode::TIMESTAMP_REORDER);
-
-  advanceClocks(time::milliseconds(1200)); // verifying at 1400ms
-  assertAccept(*i4);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // Rejects
-
-BOOST_AUTO_TEST_SUITE(Options)
-
-typedef boost::mpl::vector<
-  boost::mpl::int_<0>,
-  boost::mpl::int_<-1>
-> GraceNonPositiveValues;
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(GraceNonPositive, VALUE, GraceNonPositiveValues)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(VALUE::value);
-  initialize(options);
-
-  auto i1 = makeCommandInterest(1); // signed at 0ms
-  auto i2 = makeCommandInterest(2); // signed at 0ms
-  for (auto interest : {i1, i2}) {
-    setNameComponent(*interest, command_interest::POS_TIMESTAMP,
-                     name::Component::fromNumber(time::toUnixTimestamp(time::system_clock::now()).count()));
-  } // ensure timestamps are exactly 0ms
-
-  assertAccept(*i1); // verifying at 0ms
-
-  advanceClocks(time::milliseconds(1));
-  assertReject(*i2, CommandInterestValidator::ErrorCode::TIMESTAMP_OUT_OF_GRACE); // verifying at 1ms
-}
-
-BOOST_AUTO_TEST_CASE(TimestampsLimited)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(15);
-  options.maxTimestamps = 3;
-  initialize(options);
-
-  auto i1 = makeCommandInterest(1);
-  auto i2 = makeCommandInterest(2);
-  auto i3 = makeCommandInterest(3);
-  auto i00 = makeCommandInterest(0); // signed at 0s
-  advanceClocks(time::seconds(1));
-  auto i01 = makeCommandInterest(0); // signed at 1s
-  advanceClocks(time::seconds(1));
-  auto i02 = makeCommandInterest(0); // signed at 2s
-
-  assertAccept(*i00);
-  assertAccept(*i02);
-  assertAccept(*i1);
-  assertAccept(*i2);
-  assertAccept(*i3); // forgets identity 0
-  assertAccept(*i01); // accepted despite timestamp is reordered, because record has been evicted
-}
-
-BOOST_AUTO_TEST_CASE(TimestampsUnlimited)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(15);
-  options.maxTimestamps = -1;
-  initialize(options);
-
-  auto i1 = makeCommandInterest(0); // signed at 0s
-  advanceClocks(time::seconds(1));
-  for (int identity = 0; identity < 20; ++identity) {
-    auto i2 = makeCommandInterest(identity); // signed at +1s
-    assertAccept(*i2);
-  }
-  assertReject(*i1, CommandInterestValidator::ErrorCode::TIMESTAMP_REORDER);
-}
-
-BOOST_AUTO_TEST_CASE(TimestampsDisabled)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(15);
-  options.maxTimestamps = 0;
-  initialize(options);
-
-  auto i1 = makeCommandInterest(); // signed at 0s
-  advanceClocks(time::seconds(1));
-  auto i2 = makeCommandInterest(); // signed at +1s
-  assertAccept(*i2);
-
-  assertAccept(*i1); // accepted despite timestamp is reordered, because record isn't kept
-}
-
-BOOST_AUTO_TEST_CASE(TtlLimited)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(120);
-  options.timestampTtl = time::seconds(300);
-  initialize(options);
-
-  auto i1 = makeCommandInterest(); // signed at 0s
-  advanceClocks(time::seconds(240));
-  auto i2 = makeCommandInterest(); // signed at +240s
-  advanceClocks(time::seconds(120));
-  auto i3 = makeCommandInterest(); // signed at +360s
-
-  systemClock->advance(time::seconds(-360)); // rewind system clock to 0s
-  assertAccept(*i1);
-  assertAccept(*i3);
-
-  advanceClocks(time::seconds(30), time::seconds(301)); // advance steady clock by 301s, and system clock to +301s
-  assertAccept(*i2); // accepted despite timestamp is reordered, because record has been expired
-}
-
-BOOST_AUTO_TEST_CASE(TtlZero)
-{
-  CommandInterestValidator::Options options;
-  options.gracePeriod = time::seconds(15);
-  options.timestampTtl = time::seconds::zero();
-  initialize(options);
-
-  auto i1 = makeCommandInterest(); // signed at 0s
-  advanceClocks(time::seconds(1));
-  auto i2 = makeCommandInterest(); // signed at +1s
-  assertAccept(*i2);
-
-  assertAccept(*i1); // accepted despite timestamp is reordered, because record has been expired
-}
-
-BOOST_AUTO_TEST_SUITE_END() // Options
-
-BOOST_AUTO_TEST_SUITE_END() // TestCommandInterestValidator
-BOOST_AUTO_TEST_SUITE_END() // Security
-
-} // namespace tests
-} // namespace security
-} // namespace ndn
diff --git a/tests/unit-tests/security/validator-null.t.cpp b/tests/unit-tests/security/validator-null.t.cpp
new file mode 100644
index 0000000..b4f4102
--- /dev/null
+++ b/tests/unit-tests/security/validator-null.t.cpp
@@ -0,0 +1,66 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "security/validator-null.hpp"
+
+#include "boost-test.hpp"
+#include "identity-management-fixture.hpp"
+#include "../make-interest-data.hpp"
+
+namespace ndn {
+namespace security {
+namespace tests {
+
+using namespace ndn::tests;
+
+BOOST_AUTO_TEST_SUITE(Security)
+BOOST_FIXTURE_TEST_SUITE(TestValidatorNull, IdentityManagementFixture)
+
+BOOST_AUTO_TEST_CASE(ValidateData)
+{
+  auto identity = addIdentity("/TestValidator/Null");
+  Data data("/Some/Other/Data/Name");
+  m_keyChain.sign(data, signingByIdentity(identity));
+
+  ValidatorNull validator;
+  validator.validate(data,
+                     bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
+                     bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+}
+
+BOOST_AUTO_TEST_CASE(ValidateInterest)
+{
+  auto identity = addIdentity("/TestValidator/Null");
+  Interest interest("/Some/Other/Interest/Name");
+  m_keyChain.sign(interest, signingByIdentity(identity));
+
+  ValidatorNull validator;
+  validator.validate(interest,
+                     bind([] { BOOST_CHECK_MESSAGE(true, "Validation should succeed"); }),
+                     bind([] { BOOST_CHECK_MESSAGE(false, "Validation should not have failed"); }));
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestValidatorNull
+BOOST_AUTO_TEST_SUITE_END() // Security
+
+} // namespace tests
+} // namespace security
+} // namespace ndn
diff --git a/tests/unit-tests/security/validator.t.cpp b/tests/unit-tests/security/validator.t.cpp
index 3f26b44..6f22c5a 100644
--- a/tests/unit-tests/security/validator.t.cpp
+++ b/tests/unit-tests/security/validator.t.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/validator-null.hpp"
+#include "security/validator.hpp"
 
 #include "boost-test.hpp"
 #include "identity-management-fixture.hpp"
@@ -34,40 +34,6 @@
 BOOST_AUTO_TEST_SUITE(Security)
 BOOST_FIXTURE_TEST_SUITE(TestValidator, IdentityManagementV1Fixture)
 
-void
-onValidated(const shared_ptr<const Data>& data)
-{
-  BOOST_CHECK(true);
-}
-
-void
-onValidationFailed(const shared_ptr<const Data>& data, const std::string& failureInfo)
-{
-  BOOST_CHECK(false);
-}
-
-BOOST_AUTO_TEST_CASE(Null)
-{
-  Name identity("/TestValidator/Null");
-  identity.appendVersion();
-  addIdentity(identity, RsaKeyParams());
-
-  Name dataName = identity;
-  dataName.append("1");
-  shared_ptr<Data> data = make_shared<Data>(dataName);
-
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
-
-  ValidatorNull validator;
-
-  // data must be a shared pointer
-  validator.validate(*data,
-                     bind(&onValidated, _1),
-                     bind(&onValidationFailed, _1, _2));
-}
-
 const uint8_t ecdsaSigInfo[] = {
 0x16, 0x1b, // SignatureInfo
   0x1b, 0x01, // SignatureType
