diff --git a/src/data.cpp b/src/data.cpp
index 9a59089..6b50dca 100644
--- a/src/data.cpp
+++ b/src/data.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -246,7 +246,7 @@
 }
 
 Data&
-Data::setFreshnessPeriod(const time::milliseconds& freshnessPeriod)
+Data::setFreshnessPeriod(time::milliseconds freshnessPeriod)
 {
   resetWire();
   m_metaInfo.setFreshnessPeriod(freshnessPeriod);
@@ -254,6 +254,20 @@
 }
 
 Data&
+Data::setFinalBlock(optional<name::Component> finalBlockId)
+{
+  resetWire();
+  m_metaInfo.setFinalBlock(std::move(finalBlockId));
+  return *this;
+}
+
+name::Component
+Data::getFinalBlockId() const
+{
+  return m_metaInfo.getFinalBlockId();
+}
+
+Data&
 Data::setFinalBlockId(const name::Component& finalBlockId)
 {
   resetWire();
diff --git a/src/data.hpp b/src/data.hpp
index e0a8466..8eb1b3d 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -206,22 +206,36 @@
   Data&
   setContentType(uint32_t type);
 
-  const time::milliseconds&
+  time::milliseconds
   getFreshnessPeriod() const
   {
     return m_metaInfo.getFreshnessPeriod();
   }
 
   Data&
-  setFreshnessPeriod(const time::milliseconds& freshnessPeriod);
+  setFreshnessPeriod(time::milliseconds freshnessPeriod);
 
-  const name::Component&
-  getFinalBlockId() const
+  const optional<name::Component>&
+  getFinalBlock() const
   {
-    return m_metaInfo.getFinalBlockId();
+    return m_metaInfo.getFinalBlock();
   }
 
   Data&
+  setFinalBlock(optional<name::Component> finalBlockId);
+
+  /** @deprecated Use @c getFinalBlock
+   *  @sa MetaInfo::getFinalBlockId
+   */
+  NDN_CXX_DEPRECATED
+  name::Component
+  getFinalBlockId() const;
+
+  /** @deprecated Use @c setFinalBlock
+   *  @sa MetaInfo::setFinalBlockId
+   */
+  NDN_CXX_DEPRECATED
+  Data&
   setFinalBlockId(const name::Component& finalBlockId);
 
 protected:
diff --git a/src/meta-info.cpp b/src/meta-info.cpp
index e19c11d..c6a43a4 100644
--- a/src/meta-info.cpp
+++ b/src/meta-info.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -63,13 +63,22 @@
 }
 
 MetaInfo&
-MetaInfo::setFinalBlockId(const name::Component& finalBlockId)
+MetaInfo::setFinalBlock(optional<name::Component> finalBlockId)
 {
   m_wire.reset();
-  m_finalBlockId = finalBlockId;
+  m_finalBlockId = std::move(finalBlockId);
   return *this;
 }
 
+MetaInfo&
+MetaInfo::setFinalBlockId(const name::Component& finalBlockId)
+{
+  if (finalBlockId.isGeneric() && finalBlockId.empty()) {
+    return setFinalBlock(nullopt);
+  }
+  return setFinalBlock(finalBlockId);
+}
+
 const std::list<Block>&
 MetaInfo::getAppMetaInfo() const
 {
@@ -146,8 +155,8 @@
   }
 
   // FinalBlockId
-  if (!m_finalBlockId.empty()) {
-    totalLength += prependNestedBlock(encoder, tlv::FinalBlockId, m_finalBlockId);
+  if (m_finalBlockId) {
+    totalLength += prependNestedBlock(encoder, tlv::FinalBlockId, *m_finalBlockId);
   }
 
   // FreshnessPeriod
@@ -218,16 +227,11 @@
 
   // FinalBlockId
   if (val != m_wire.elements_end() && val->type() == tlv::FinalBlockId) {
-    m_finalBlockId = val->blockFromValue();
-    if (m_finalBlockId.type() != tlv::NameComponent)
-      {
-        /// @todo May or may not throw exception later...
-        m_finalBlockId = name::Component();
-      }
+    m_finalBlockId.emplace(val->blockFromValue());
     ++val;
   }
   else {
-    m_finalBlockId = name::Component();
+    m_finalBlockId = nullopt;
   }
 
   // AppMetaInfo (if any)
@@ -248,9 +252,9 @@
   }
 
   // FinalBlockId
-  if (!info.getFinalBlockId().empty()) {
+  if (info.getFinalBlock()) {
     os << ", FinalBlockId: ";
-    info.getFinalBlockId().toUri(os);
+    info.getFinalBlock()->toUri(os);
   }
 
   // App-defined MetaInfo items
diff --git a/src/meta-info.hpp b/src/meta-info.hpp
index e8e8a00..911b1a3 100644
--- a/src/meta-info.hpp
+++ b/src/meta-info.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -87,27 +87,71 @@
   wireDecode(const Block& wire);
 
 public: // getter/setter
+  /** @brief return ContentType
+   *
+   *  If ContentType element is omitted, returns \c tlv::ContentType_Blob.
+   */
   uint32_t
-  getType() const;
+  getType() const
+  {
+    return m_type;
+  }
 
   /** @brief set ContentType
-   *  @param type a code defined in tlv::ContentTypeValue
+   *  @param type a number defined in \c tlv::ContentTypeValue
    */
   MetaInfo&
   setType(uint32_t type);
 
-  const time::milliseconds&
-  getFreshnessPeriod() const;
+  /** @brief return FreshnessPeriod
+   *
+   *  If FreshnessPeriod element is omitted, returns \c DEFAULT_FRESHNESS_PERIOD.
+   */
+  time::milliseconds
+  getFreshnessPeriod() const
+  {
+    return m_freshnessPeriod;
+  }
 
   /** @brief set FreshnessPeriod
-   *  @throw std::invalid_argument specified FreshnessPeriod is < 0
+   *  @throw std::invalid_argument specified FreshnessPeriod is negative
    */
   MetaInfo&
   setFreshnessPeriod(time::milliseconds freshnessPeriod);
 
-  const name::Component&
-  getFinalBlockId() const;
+  /** @brief return FinalBlockId
+   */
+  const optional<name::Component>&
+  getFinalBlock() const
+  {
+    return m_finalBlockId;
+  }
 
+  /** @brief set FinalBlockId
+   */
+  MetaInfo&
+  setFinalBlock(optional<name::Component> finalBlockId);
+
+  /** @brief return FinalBlockId
+   *  @deprecated use @c getFinalBlock
+   *
+   *  If FinalBlockId element is omitted, returns a default-constructed @c name::Component.
+   *  This is indistinguishable from having an empty GenericNameComponent as FinalBlockId.
+   */
+  NDN_CXX_DEPRECATED
+  name::Component
+  getFinalBlockId() const
+  {
+    return getFinalBlock().value_or(name::Component());
+  }
+
+  /** @brief set FinalBlockId
+   *  @deprecated use @c setFinalBlock
+   *
+   *  Passing a default-constructed @c name::Component removes FinalBlockId element.
+   *  This API does not support adding an empty GenericNameComponent as FinalBlockId.
+   */
+  NDN_CXX_DEPRECATED
   MetaInfo&
   setFinalBlockId(const name::Component& finalBlockId);
 
@@ -117,7 +161,7 @@
    *
    * @note Warning: Experimental API, which may change or disappear in the future
    *
-   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlockId
+   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlock
    *       is called before *AppMetaInfo, all app-defined blocks will be lost
    */
   const std::list<Block>&
@@ -133,7 +177,7 @@
    *
    * @note Warning: Experimental API, which may change or disappear in the future
    *
-   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlockId
+   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlock
    *       is called before *AppMetaInfo, all app-defined blocks will be lost
    */
   MetaInfo&
@@ -147,7 +191,7 @@
    *
    * @note Warning: Experimental API, which may change or disappear in the future
    *
-   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlockId
+   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlock
    *       is called before *AppMetaInfo, all app-defined blocks will be lost
    */
   MetaInfo&
@@ -160,7 +204,7 @@
    *
    * @note Warning: Experimental API, which may change or disappear in the future
    *
-   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlockId
+   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlock
    *       is called before *AppMetaInfo, all app-defined blocks will be lost
    */
   bool
@@ -176,7 +220,7 @@
    *
    * @note Warning: Experimental API, which may change or disappear in the future
    *
-   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlockId
+   * @note If MetaInfo is decoded from wire and setType, setFreshnessPeriod, or setFinalBlock
    *       is called before *AppMetaInfo, all app-defined blocks will be lost
    */
   const Block*
@@ -192,7 +236,7 @@
 private:
   uint32_t m_type;
   time::milliseconds m_freshnessPeriod;
-  name::Component m_finalBlockId;
+  optional<name::Component> m_finalBlockId;
   std::list<Block> m_appMetaInfo;
 
   mutable Block m_wire;
@@ -203,24 +247,6 @@
 std::ostream&
 operator<<(std::ostream& os, const MetaInfo& info);
 
-inline uint32_t
-MetaInfo::getType() const
-{
-  return m_type;
-}
-
-inline const time::milliseconds&
-MetaInfo::getFreshnessPeriod() const
-{
-  return m_freshnessPeriod;
-}
-
-inline const name::Component&
-MetaInfo::getFinalBlockId() const
-{
-  return m_finalBlockId;
-}
-
 inline bool
 MetaInfo::operator==(const MetaInfo& other) const
 {
diff --git a/src/mgmt/dispatcher.cpp b/src/mgmt/dispatcher.cpp
index df27aca..2a14a91 100644
--- a/src/mgmt/dispatcher.cpp
+++ b/src/mgmt/dispatcher.cpp
@@ -313,7 +313,7 @@
 
   MetaInfo metaInfo;
   if (isFinalBlock) {
-    metaInfo.setFinalBlockId(dataName[-1]);
+    metaInfo.setFinalBlock(dataName[-1]);
   }
 
   sendData(dataName, content, metaInfo, destination, imsFresh);
diff --git a/src/security/v2/certificate-bundle-fetcher.cpp b/src/security/v2/certificate-bundle-fetcher.cpp
index e2fdab9..45a0c38 100644
--- a/src/security/v2/certificate-bundle-fetcher.cpp
+++ b/src/security/v2/certificate-bundle-fetcher.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -160,9 +160,9 @@
   else {
     state->setTag(make_shared<BundleNameTag>(bundleData.getName()));
 
-    const name::Component& finalBlockId = bundleData.getMetaInfo().getFinalBlockId();
-    if (!finalBlockId.empty()) {
-      state->setTag(make_shared<FinalBlockIdTag>(finalBlockId));
+    const auto& finalBlockId = bundleData.getFinalBlock();
+    if (!finalBlockId) {
+      state->setTag(make_shared<FinalBlockIdTag>(*finalBlockId));
     }
 
     Block bundleContent = bundleData.getContent();
diff --git a/src/util/segment-fetcher.cpp b/src/util/segment-fetcher.cpp
index b23b991..90cddaf 100644
--- a/src/util/segment-fetcher.cpp
+++ b/src/util/segment-fetcher.cpp
@@ -131,8 +131,8 @@
       m_buffer->write(reinterpret_cast<const char*>(data.getContent().value()),
                       data.getContent().value_size());
       afterSegmentValidated(data);
-      const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
-      if (finalBlockId.empty() || (finalBlockId > currentSegment)) {
+      const auto& finalBlockId = data.getFinalBlock();
+      if (!finalBlockId || (*finalBlockId > currentSegment)) {
         fetchNextSegment(origInterest, data.getName(), currentSegment.toSegment() + 1, self);
       }
       else {
diff --git a/tests/unit-tests/meta-info.t.cpp b/tests/unit-tests/meta-info.t.cpp
index 43935e3..9e04b78 100644
--- a/tests/unit-tests/meta-info.t.cpp
+++ b/tests/unit-tests/meta-info.t.cpp
@@ -22,6 +22,7 @@
 #include "meta-info.hpp"
 #include "data.hpp"
 
+#include "block-literal.hpp"
 #include "boost-test.hpp"
 
 namespace ndn {
@@ -29,79 +30,53 @@
 
 BOOST_AUTO_TEST_SUITE(TestMetaInfo)
 
-const uint8_t MetaInfo1[] = {0x14, 0x04, 0x19, 0x02, 0x27, 0x10};
-const uint8_t MetaInfo2[] = {0x14, 0x14, 0x19, 0x02, 0x27, 0x10, 0x1a, 0x0e, 0x08, 0x0c,
-                             0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x77, 0x6f, 0x72, 0x6c,
-                             0x64, 0x21};
-const uint8_t MetaInfo3[] = {0x14, 0x17, 0x18, 0x01, 0x01, 0x19, 0x02, 0x27, 0x10, 0x1a,
-                             0x0e, 0x08, 0x0c, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x77,
-                             0x6f, 0x72, 0x6c, 0x64, 0x21};
-
-BOOST_AUTO_TEST_CASE(Encode)
+BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(EncodeDecodeEquality, 1)
+BOOST_AUTO_TEST_CASE(EncodeDecodeEquality)
 {
-  MetaInfo meta;
-  meta.setType(tlv::ContentType_Blob);
-  meta.setFreshnessPeriod(10_s);
+  // default values
+  MetaInfo a("1406 type=180100 freshness=190100"_block);
+  BOOST_CHECK_EQUAL(a.getType(), tlv::ContentType_Blob);
+  BOOST_CHECK_EQUAL(a.getFreshnessPeriod(), 0_ms);
+  BOOST_CHECK(!a.getFinalBlock());
+  BOOST_CHECK_EQUAL(a.getFinalBlockId(), name::Component());
+  BOOST_CHECK_EQUAL(a, a);
 
-  BOOST_REQUIRE_NO_THROW(meta.wireEncode());
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(MetaInfo1, MetaInfo1+sizeof(MetaInfo1),
-                                  meta.wireEncode().begin(), meta.wireEncode().end());
-
-  meta.setFinalBlockId(name::Component("hello,world!"));
-  BOOST_REQUIRE_NO_THROW(meta.wireEncode());
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(MetaInfo2, MetaInfo2+sizeof(MetaInfo2),
-                                  meta.wireEncode().begin(), meta.wireEncode().end());
-
-  meta.setType(tlv::ContentType_Link);
-  BOOST_REQUIRE_NO_THROW(meta.wireEncode());
-  BOOST_REQUIRE_EQUAL_COLLECTIONS(MetaInfo3, MetaInfo3+sizeof(MetaInfo3),
-                                  meta.wireEncode().begin(), meta.wireEncode().end());
-}
-
-BOOST_AUTO_TEST_CASE(Decode)
-{
-  MetaInfo meta(Block(MetaInfo1, sizeof(MetaInfo1)));
-  BOOST_CHECK_EQUAL(meta.getType(), static_cast<uint32_t>(tlv::ContentType_Blob));
-  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), 10_s);
-  BOOST_CHECK_EQUAL(meta.getFinalBlockId(), name::Component());
-
-  meta.wireDecode(Block(MetaInfo2, sizeof(MetaInfo2)));
-  BOOST_CHECK_EQUAL(meta.getType(), static_cast<uint32_t>(tlv::ContentType_Blob));
-  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), 10_s);
-  BOOST_CHECK_EQUAL(meta.getFinalBlockId(), name::Component("hello,world!"));
-
-  meta.wireDecode(Block(MetaInfo3, sizeof(MetaInfo3)));
-  BOOST_CHECK_EQUAL(meta.getType(), static_cast<uint32_t>(tlv::ContentType_Link));
-  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), 10_s);
-  BOOST_CHECK_EQUAL(meta.getFinalBlockId(), name::Component("hello,world!"));
-}
-
-BOOST_AUTO_TEST_CASE(EqualityChecks)
-{
-  MetaInfo a;
   MetaInfo b;
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
+  BOOST_CHECK_NE(a, b);
+  b.setType(a.getType());
+  b.setFreshnessPeriod(a.getFreshnessPeriod());
+  b.setFinalBlock(a.getFinalBlock());
+  BOOST_CHECK(b.wireEncode() == "1400"_block);
+  BOOST_CHECK_EQUAL(a, b); // expected failure #4569
 
-  a.setFreshnessPeriod(10_s);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
+  // non-default values
+  Block wire2 = "140C type=180101 freshness=190266B2 finalblock=1A03080141"_block;
+  a.wireDecode(wire2);
+  BOOST_CHECK_EQUAL(a.getType(), tlv::ContentType_Link);
+  BOOST_CHECK_EQUAL(a.getFreshnessPeriod(), 26290_ms);
+  BOOST_CHECK_EQUAL(*a.getFinalBlock(), name::Component("A"));
+  BOOST_CHECK_EQUAL(a.getFinalBlockId(), name::Component("A"));
+  BOOST_CHECK_NE(a, b);
 
-  b.setFreshnessPeriod(90_s);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
+  b.setType(a.getType());
+  b.setFreshnessPeriod(a.getFreshnessPeriod());
+  b.setFinalBlockId(a.getFinalBlockId());
+  BOOST_CHECK(b.wireEncode() == wire2);
+  BOOST_CHECK_EQUAL(a, b);
 
-  b.setFreshnessPeriod(10_s);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
+  // FinalBlockId is typed name component
+  Block wire3 = "1405 finalblock=1A03DD0141"_block;
+  a.wireDecode(wire3);
+  BOOST_CHECK_EQUAL(a.getType(), tlv::ContentType_Blob);
+  BOOST_CHECK_EQUAL(a.getFreshnessPeriod(), 0_ms);
+  BOOST_CHECK_EQUAL(*a.getFinalBlock(), name::Component::fromEscapedString("221=A"));
+  BOOST_CHECK_NE(a, b);
 
-  a.setType(10);
-  BOOST_CHECK_EQUAL(a == b, false);
-  BOOST_CHECK_EQUAL(a != b, true);
-
-  b.setType(10);
-  BOOST_CHECK_EQUAL(a == b, true);
-  BOOST_CHECK_EQUAL(a != b, false);
+  b.setType(a.getType());
+  b.setFreshnessPeriod(a.getFreshnessPeriod());
+  b.setFinalBlockId(a.getFinalBlockId());
+  BOOST_CHECK(b.wireEncode() == wire3);
+  BOOST_CHECK_EQUAL(a, b);
 }
 
 BOOST_AUTO_TEST_CASE(AppMetaInfo)
@@ -109,7 +84,7 @@
   MetaInfo info1;
   info1.setType(196);
   info1.setFreshnessPeriod(3600_ms);
-  info1.setFinalBlockId(name::Component("/att/final"));
+  info1.setFinalBlock(name::Component("/att/final"));
 
   uint32_t ints[5] = {128, 129, 130, 131, 132};
   std::string ss[5] = {"h", "hello", "hello, world", "hello, world, alex",
@@ -188,56 +163,6 @@
   BOOST_CHECK_THROW(info.addAppMetaInfo(makeNonNegativeIntegerBlock(253, 1000)), MetaInfo::Error);
 }
 
-BOOST_AUTO_TEST_CASE(EncodeDecodeFreshnessPeriod)
-{
-  const uint8_t expectedDefault[] = {
-    0x14, 0x00, // MetaInfo
-  };
-
-  const uint8_t expected1000ms[] = {
-    0x14, 0x04, // MetaInfo
-          0x19, 0x02, // FreshnessPeriod
-                0x03, 0xe8 // 1000ms
-  };
-
-  MetaInfo info;
-  BOOST_CHECK_EQUAL_COLLECTIONS(info.wireEncode().begin(), info.wireEncode().end(),
-                                expectedDefault, expectedDefault + sizeof(expectedDefault));
-
-  info.setFreshnessPeriod(time::milliseconds::zero());
-  BOOST_CHECK_EQUAL_COLLECTIONS(info.wireEncode().begin(), info.wireEncode().end(),
-                                expectedDefault, expectedDefault + sizeof(expectedDefault));
-
-  info.setFreshnessPeriod(1000_ms);
-  BOOST_CHECK_EQUAL_COLLECTIONS(info.wireEncode().begin(), info.wireEncode().end(),
-                                expected1000ms, expected1000ms + sizeof(expected1000ms));
-
-  const uint8_t inputDefault[] = {
-    0x14, 0x03, // MetaInfo
-          0x19, 0x01, // FreshnessPeriod
-                0x00  // 0ms
-  };
-
-  const uint8_t input2000ms[] = {
-    0x14, 0x04, // MetaInfo
-          0x19, 0x02, // FreshnessPeriod
-                0x07, 0xd0 // 2000ms
-  };
-
-  Block inputDefaultBlock(inputDefault, sizeof(inputDefault));
-  BOOST_CHECK_NO_THROW(info.wireDecode(inputDefaultBlock));
-  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), time::milliseconds::zero());
-
-  Block input2000msBlock(input2000ms, sizeof(input2000ms));
-  BOOST_CHECK_NO_THROW(info.wireDecode(input2000msBlock));
-  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), 2000_ms);
-
-  BOOST_CHECK_NO_THROW(info.setFreshnessPeriod(10000_ms));
-  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), 10000_ms);
-  BOOST_CHECK_THROW(info.setFreshnessPeriod(time::milliseconds(-1)), std::invalid_argument);
-  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), 10000_ms);
-}
-
 BOOST_AUTO_TEST_SUITE_END() // TestMetaInfo
 
 } // namespace tests
diff --git a/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp b/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp
index 2abbdaa..12a7fa1 100644
--- a/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp
@@ -98,7 +98,7 @@
     }
 
     auto data = make_shared<Data>(name);
-    data->setFinalBlockId(data->getName()[-1]);
+    data->setFinalBlock(name[-1]);
     return data;
   }
 };
diff --git a/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp b/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
index f9bc22c..d2e0565 100644
--- a/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
+++ b/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
@@ -128,7 +128,7 @@
   certBundle->setName(bundleName);
   certBundle->setFreshnessPeriod(100_s);
   certBundle->setContent(certList);
-  certBundle->setFinalBlockId(name::Component::fromSegment(1));
+  certBundle->setFinalBlock(name::Component::fromSegment(1));
 
   m_keyChain.sign(*certBundle, signingWithSha256());
 
diff --git a/tests/unit-tests/util/segment-fetcher.t.cpp b/tests/unit-tests/util/segment-fetcher.t.cpp
index edcb9ca..c4d6bb8 100644
--- a/tests/unit-tests/util/segment-fetcher.t.cpp
+++ b/tests/unit-tests/util/segment-fetcher.t.cpp
@@ -55,7 +55,7 @@
     auto data = make_shared<Data>(Name(baseName).appendSegment(segment));
     data->setContent(buffer, sizeof(buffer));
     if (isFinal) {
-      data->setFinalBlockId(data->getName()[-1]);
+      data->setFinalBlock(data->getName()[-1]);
     }
 
     return signData(data);
