comm: Fix sync update prefix initialization

refs: #2399

Change-Id: I35c454e46c0b9552dba2a38b674d1ad3629f8bef
diff --git a/src/communication/sync-logic-handler.cpp b/src/communication/sync-logic-handler.cpp
index 5f87436..94ac76b 100644
--- a/src/communication/sync-logic-handler.cpp
+++ b/src/communication/sync-logic-handler.cpp
@@ -141,9 +141,6 @@
   , m_confParam(conf)
   , m_sequencingManager(seqManager)
 {
-  m_updatePrefix = m_confParam.getLsaPrefix();
-  m_updatePrefix.append(m_confParam.getSiteName());
-  m_updatePrefix.append(m_confParam.getRouterName());
 }
 
 void
@@ -269,6 +266,14 @@
 }
 
 void
+SyncLogicHandler::buildUpdatePrefix()
+{
+  m_updatePrefix = m_confParam.getLsaPrefix();
+  m_updatePrefix.append(m_confParam.getSiteName());
+  m_updatePrefix.append(m_confParam.getRouterName());
+}
+
+void
 SyncLogicHandler::publishSyncUpdate(const ndn::Name& updatePrefix, uint64_t seqNo)
 {
   _LOG_DEBUG("Publishing Sync Update. Prefix: " << updatePrefix << " Seq No: " << seqNo);
diff --git a/src/communication/sync-logic-handler.hpp b/src/communication/sync-logic-handler.hpp
index e602037..6a2c443 100644
--- a/src/communication/sync-logic-handler.hpp
+++ b/src/communication/sync-logic-handler.hpp
@@ -29,6 +29,8 @@
 #include <unistd.h>
 #include <boost/cstdint.hpp>
 
+#include "test-access-control.hpp"
+
 class InterestManager;
 
 namespace nlsr {
@@ -62,6 +64,9 @@
     m_syncPrefix.set(sp);
   }
 
+  void
+  buildUpdatePrefix();
+
 private:
   void
   processUpdateFromSync(const SyncUpdate& updateName);
@@ -81,12 +86,15 @@
   ndn::shared_ptr<Sync::SyncSocket> m_syncSocket;
   ndn::Name m_syncPrefix;
 
+private:
   Lsdb& m_lsdb;
   ConfParameter& m_confParam;
   const SequencingManager& m_sequencingManager;
 
+PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   ndn::Name m_updatePrefix;
 
+private:
   static const std::string NLSR_COMPONENT;
   static const std::string LSA_COMPONENT;
   static const std::string NAME_COMPONENT;