diff --git a/tests/manager-common-fixture.cpp b/tests/manager-common-fixture.cpp
index bdda72e..9511951 100644
--- a/tests/manager-common-fixture.cpp
+++ b/tests/manager-common-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,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -62,15 +62,15 @@
 void
 ManagerCommonFixture::setTopPrefix(const Name& topPrefix)
 {
-  m_dispatcher.addTopPrefix(topPrefix); // such that all filters are added
-  advanceClocks(time::milliseconds(1));
+  m_dispatcher.addTopPrefix(topPrefix); // so that all filters are added
+  advanceClocks(1_ms);
 }
 
 void
 ManagerCommonFixture::receiveInterest(const Interest& interest)
 {
   m_face.receive(interest);
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 }
 
 ControlResponse
@@ -142,12 +142,7 @@
 Block
 ManagerCommonFixture::concatenateResponses(size_t startIndex, size_t nResponses)
 {
-  auto isFinalSegment = [] (const Data& data) -> bool {
-    const name::Component& lastComponent = data.getName().at(-1);
-    return !lastComponent.isSegment() || lastComponent == data.getFinalBlockId();
-  };
-
-  while (!isFinalSegment(m_responses.back())) {
+  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;
diff --git a/tests/tools/mock-nfd-mgmt-fixture.hpp b/tests/tools/mock-nfd-mgmt-fixture.hpp
index eb102eb..0a67326 100644
--- a/tests/tools/mock-nfd-mgmt-fixture.hpp
+++ b/tests/tools/mock-nfd-mgmt-fixture.hpp
@@ -29,6 +29,8 @@
 #include "tests/test-common.hpp"
 #include "tests/identity-management-fixture.hpp"
 
+#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
+#include <ndn-cxx/mgmt/nfd/control-response.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
 
 namespace nfd {
@@ -148,11 +150,11 @@
   virtual void
   processEventsOverride(time::milliseconds timeout)
   {
-    if (timeout <= time::milliseconds::zero()) {
+    if (timeout <= 0_ms) {
       // give enough time to finish execution
-      timeout = time::seconds(30);
+      timeout = 30_s;
     }
-    this->advanceClocks(time::milliseconds(100), timeout);
+    this->advanceClocks(100_ms, timeout);
   }
 
   void
@@ -167,8 +169,7 @@
   sendCommandReply(const Interest& interest, uint32_t code, const std::string& text,
                    const Block& body)
   {
-    this->sendCommandReply(interest,
-                           ndn::nfd::ControlResponse(code, text).setBody(body));
+    this->sendCommandReply(interest, ndn::nfd::ControlResponse(code, text).setBody(body));
   }
 
   /** \brief send a payload in reply to StatusDataset request
@@ -193,7 +194,7 @@
     }
 
     auto data = make_shared<Data>(name);
-    data->setFinalBlockId(name[-1]);
+    data->setFinalBlock(name[-1]);
     data->setContent(std::forward<ContentArgs>(contentArgs)...);
     this->signDatasetReply(*data);
     face.receive(*data);
diff --git a/tests/tools/ndn-autoconfig-server/program.t.cpp b/tests/tools/ndn-autoconfig-server/program.t.cpp
index 7a4a216..1b928b0 100644
--- a/tests/tools/ndn-autoconfig-server/program.t.cpp
+++ b/tests/tools/ndn-autoconfig-server/program.t.cpp
@@ -105,7 +105,7 @@
   BOOST_CHECK(dataName0.at(-2).isVersion());
   BOOST_CHECK(dataName0.at(-1).isSegment());
 
-  while (face.sentData.back().getFinalBlockId() != face.sentData.back().getName().at(-1)) {
+  while (face.sentData.back().getFinalBlock() != face.sentData.back().getName().at(-1)) {
     const Name& lastName = face.sentData.back().getName();
     Interest interest2(lastName.getPrefix(-1).appendSegment(lastName.at(-1).toSegment() + 1));
     face.receive(interest2);
