diff --git a/tests/publisher/publisher-fixture.hpp b/tests/publisher/publisher-fixture.hpp
index 9156c7b..4b702fc 100644
--- a/tests/publisher/publisher-fixture.hpp
+++ b/tests/publisher/publisher-fixture.hpp
@@ -30,6 +30,9 @@
 
 #include <ndn-cxx/util/dummy-client-face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/pib/identity.hpp>
+
+#include <ndn-cxx/util/io.hpp>
 
 #include <boost/filesystem.hpp>
 
@@ -42,13 +45,16 @@
 {
 public:
   PublisherFixture()
-    : face(g_ioService, keyChain, {true, true})
-    , nlsr(g_ioService, g_scheduler, face, g_keyChain)
+    : face(m_ioService, m_keyChain, {true, true})
+    , nlsr(m_ioService, m_scheduler, face, m_keyChain)
     , lsdb(nlsr.getLsdb())
   {
-    INIT_LOGGERS("/tmp/","TRACE");
+    INIT_LOGGERS("/tmp/", "TRACE");
     nlsr.getConfParameter().setNetwork("/ndn");
     nlsr.getConfParameter().setRouterName("/This/Router");
+
+    routerId = addIdentity("/ndn/This/Router");
+
     nlsr.initialize();
     face.processEvents(ndn::time::milliseconds(100));
   }
@@ -56,7 +62,7 @@
   void
   addAdjacency(AdjLsa& lsa, const std::string& name, const std::string& faceUri, double cost)
   {
-    Adjacent adjacency(name, ndn::util::FaceUri(faceUri), cost, Adjacent::STATUS_ACTIVE, 0, 0);
+    Adjacent adjacency(name, ndn::FaceUri(faceUri), cost, Adjacent::STATUS_ACTIVE, 0, 0);
     lsa.addAdjacent(std::move(adjacency));
   }
 
@@ -148,10 +154,11 @@
 
 public:
   ndn::util::DummyClientFace face;
-  ndn::KeyChain keyChain;
 
   Nlsr nlsr;
   Lsdb& lsdb;
+
+  ndn::security::pib::Identity routerId;
 };
 
 } // namespace test
diff --git a/tests/publisher/test-segment-publisher.cpp b/tests/publisher/test-segment-publisher.cpp
index c6b4fba..e1a7232 100644
--- a/tests/publisher/test-segment-publisher.cpp
+++ b/tests/publisher/test-segment-publisher.cpp
@@ -26,6 +26,7 @@
 #include "publisher/segment-publisher.hpp"
 
 #include "../boost-test.hpp"
+#include "../test-common.hpp"
 
 #include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/util/dummy-client-face.hpp>
@@ -36,14 +37,17 @@
 namespace nlsr {
 namespace tests {
 
+using namespace nlsr::test;
+
 template<int64_t N=10000>
 class TestSegmentPublisher : public SegmentPublisher<ndn::util::DummyClientFace>
 {
 public:
   TestSegmentPublisher(ndn::util::DummyClientFace& face,
                        ndn::KeyChain& keyChain,
+                       ndn::security::SigningInfo& signingInfo,
                        const ndn::time::milliseconds freshnessPeriod)
-    : SegmentPublisher(face, keyChain, freshnessPeriod)
+    : SegmentPublisher(face, keyChain, signingInfo, freshnessPeriod)
     , m_totalPayloadLength(0)
   {
 
@@ -72,10 +76,10 @@
   generate(ndn::EncodingBuffer& outBuffer)
   {
     size_t totalLength = 0;
-    for (int64_t i = 0; i < N; i++)
-      {
+    for (int64_t i = 0; i < N; i++) {
         totalLength += prependNonNegativeIntegerBlock(outBuffer, ndn::tlv::Content, i);
-      }
+    }
+
     m_totalPayloadLength += totalLength;
     return totalLength;
   }
@@ -85,13 +89,13 @@
 };
 
 template<int64_t N>
-class SegmentPublisherFixture
+class SegmentPublisherFixture : public BaseFixture
 {
 public:
   SegmentPublisherFixture()
-    : m_face(std::make_shared<ndn::util::DummyClientFace>())
+    : m_face(std::make_shared<ndn::util::DummyClientFace>(m_ioService, m_keyChain))
     , m_expectedFreshnessPeriod(ndn::time::milliseconds(111))
-    , m_publisher(*m_face, m_keyChain, m_expectedFreshnessPeriod)
+    , m_publisher(*m_face, m_keyChain, m_signingInfo, m_expectedFreshnessPeriod)
     , m_publishingPrefix("/localhost/nfd/SegmentPublisherFixture")
   {
   }
@@ -106,10 +110,9 @@
     m_buffer.appendByteArray(payload.value(), payload.value_size());
 
     // uint64_t segmentNo = data.getName()[-1].toSegment();
-    if (data.getFinalBlockId() != data.getName()[-1])
-      {
+    if (data.getFinalBlockId() != data.getName()[-1]) {
         return;
-      }
+    }
 
     // wrap data in a single Content TLV for easy parsing
     m_buffer.prependVarNumber(m_buffer.size());
@@ -138,7 +141,7 @@
   const ndn::time::milliseconds m_expectedFreshnessPeriod;
   TestSegmentPublisher<N> m_publisher;
   ndn::EncodingBuffer m_buffer;
-  ndn::KeyChain m_keyChain;
+  ndn::security::SigningInfo m_signingInfo;
   const ndn::Name m_publishingPrefix;
 };
 
