diff --git a/tests/publisher/test-segment-publisher.cpp b/tests/publisher/test-segment-publisher.cpp
index e1a7232..a70e57f 100644
--- a/tests/publisher/test-segment-publisher.cpp
+++ b/tests/publisher/test-segment-publisher.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,
@@ -110,8 +110,8 @@
     m_buffer.appendByteArray(payload.value(), payload.value_size());
 
     // uint64_t segmentNo = data.getName()[-1].toSegment();
-    if (data.getFinalBlockId() != data.getName()[-1]) {
-        return;
+    if (data.getFinalBlock().value_or(ndn::name::Component("")) != data.getName()[-1]) {
+      return;
     }
 
     // wrap data in a single Content TLV for easy parsing
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index 04efefc..13b0b19 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -153,7 +153,7 @@
     }
 
     auto data = make_shared<ndn::Data>(name);
-    data->setFinalBlockId(name[-1]);
+    data->setFinalBlock(name[-1]);
     data->setContent(std::forward<ContentArgs>(contentArgs)...);
     this->signDatasetReply(*data);
     m_face.receive(*data);
diff --git a/tests/test-lsa-segment-storage.cpp b/tests/test-lsa-segment-storage.cpp
index e690ae8..85806c2 100644
--- a/tests/test-lsa-segment-storage.cpp
+++ b/tests/test-lsa-segment-storage.cpp
@@ -42,7 +42,6 @@
     , nlsr(m_ioService, m_scheduler, face, m_keyChain)
     , lsdb(nlsr.getLsdb())
     , lsaStorage(lsdb.getLsaStorage())
-    , lsaGeneratedBeforeNow(180)
   {
   }
 
@@ -53,7 +52,7 @@
     ndn::Name s2{"name2"};
     NamePrefixList npl1{s1, s2};
     NameLsa nameLsa("/ndn/other-site/%C1.Router/other-router", 12,
-                    ndn::time::system_clock::now() - lsaGeneratedBeforeNow, npl1);
+                    ndn::time::system_clock::now() + ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT), npl1);
     return nameLsa.serialize();
   }
 
@@ -66,7 +65,7 @@
     std::string content = makeLsaContent();
     lsaSegment->setContent(reinterpret_cast<const uint8_t*>(content.c_str()), content.length());
     if (isFinal) {
-      lsaSegment->setFinalBlockId(lsaSegment->getName()[-1]);
+      lsaSegment->setFinalBlock(lsaSegment->getName()[-1]);
     }
 
     return signData(lsaSegment);
@@ -92,7 +91,6 @@
   Nlsr nlsr;
   Lsdb& lsdb;
   LsaSegmentStorage& lsaStorage;
-  ndn::time::seconds lsaGeneratedBeforeNow;
 };
 
 BOOST_FIXTURE_TEST_SUITE(TestLsaSegmentStorage, LsaSegmentStorageFixture)
@@ -174,7 +172,11 @@
 
   BOOST_CHECK(lsaStorage.getLsaSegment(ndn::Interest(lsaInterestName)) != nullptr);
 
-  advanceClocks(ndn::time::milliseconds(lsaGeneratedBeforeNow), 10);
+  // Make sure it was not deleted earlier somehow
+  advanceClocks(ndn::time::seconds(100), 10);
+  BOOST_CHECK(lsaStorage.getLsaSegment(ndn::Interest(lsaInterestName)) != nullptr);
+
+  advanceClocks(ndn::time::seconds(LSA_REFRESH_TIME_DEFAULT), 10);
 
   BOOST_CHECK(lsaStorage.getLsaSegment(ndn::Interest(lsaInterestName)) == nullptr);
 }
