diff --git a/tests/unit-tests/lp/packet.t.cpp b/tests/unit-tests/lp/packet.t.cpp
index 5f9b2d2..1583772 100644
--- a/tests/unit-tests/lp/packet.t.cpp
+++ b/tests/unit-tests/lp/packet.t.cpp
@@ -20,9 +20,11 @@
  */
 
 #include "lp/packet.hpp"
+#include "prefix-announcement.hpp"
 #include "security/signature-sha256-with-rsa.hpp"
 
 #include "boost-test.hpp"
+#include "identity-management-fixture.hpp"
 
 namespace ndn {
 namespace lp {
@@ -402,54 +404,6 @@
                                 encoded.begin(), encoded.end());
 }
 
-BOOST_AUTO_TEST_CASE(DecodePrefixAnnouncement)
-{
-  static const uint8_t inputBlock[] = {
-    0x64, 0x70, // LpPacket
-      0xfd, 0x03, 0x50, 0x3a, // PrefixAnnouncement
-        0x06, 0x38, // Data
-          0x07, 0x29, 0x08, 0x0d, 0x73, 0x65, 0x6c, 0x66, 0x2d, 0x6c,
-          0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x08, 0x03, 0x65,
-          0x64, 0x75, 0x08, 0x02, 0x75, 0x61, 0x08, 0x02, 0x63, 0x73,
-          0x08, 0x04, 0x6e, 0x65, 0x77, 0x73, 0x08, 0x05, 0xfd, 0x00,
-          0x03, 0xa5, 0xfe, 0x14, 0x00, 0x15, 0x00, 0x16, 0x05, 0x1b,
-          0x01, 0x01, 0x1c, 0x00, 0x17, 0x00,
-      0x50, 0x30, // Fragment
-        0x06, 0x2e,  // Data
-          0x07, 0x1f, 0x08, 0x03, 0x65, 0x64, 0x75, 0x08, 0x02, 0x75,
-          0x61, 0x08, 0x02, 0x63, 0x73, 0x08, 0x04, 0x6e, 0x65, 0x77,
-          0x73, 0x08, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68,
-          0x74, 0x6d, 0x6c, 0x14, 0x00, 0x15, 0x00, 0x16, 0x05, 0x1b,
-          0x01, 0x01, 0x1c, 0x00, 0x17, 0x00,
-  };
-
-  Data data1("/edu/ua/cs/news/index.html");
-  ndn::SignatureSha256WithRsa fakeSignature;
-  fakeSignature.setValue(ndn::encoding::makeEmptyBlock(ndn::tlv::SignatureValue));
-  data1.setSignature(fakeSignature);
-
-  Block wire;
-  wire = data1.wireEncode();
-  Packet packet;
-  BOOST_CHECK_NO_THROW(packet.wireDecode(wire));
-
-  Name name("/self-learning/edu/ua/cs/news");
-  name.appendVersion(239102);
-  Data data2(name);
-  fakeSignature.setValue(ndn::encoding::makeEmptyBlock(ndn::tlv::SignatureValue));
-  data2.setSignature(fakeSignature);
-  data2.wireEncode();
-
-  PrefixAnnouncement pa;
-  pa.setData(make_shared<Data>(data2));
-
-  BOOST_CHECK_NO_THROW(packet.add<PrefixAnnouncementField>(pa));
-  Block encoded;
-  BOOST_CHECK_NO_THROW(encoded = packet.wireEncode());
-  BOOST_CHECK_EQUAL_COLLECTIONS(inputBlock, inputBlock + sizeof(inputBlock),
-                                encoded.begin(), encoded.end());
-}
-
 BOOST_AUTO_TEST_CASE(DecodeUnrecognizedTlvType)
 {
   Packet packet;
@@ -457,6 +411,40 @@
   BOOST_CHECK_THROW(packet.wireDecode(wire), Packet::Error);
 }
 
+BOOST_FIXTURE_TEST_CASE(DecodePrefixAnnouncement, ndn::tests::IdentityManagementFixture)
+{
+  // Construct Data which prefix announcement is attached to
+  Data data0("/edu/ua/cs/news/index.html");
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::encoding::makeEmptyBlock(ndn::tlv::SignatureValue));
+  data0.setSignature(fakeSignature);
+
+  Block wire;
+  wire = data0.wireEncode();
+  Packet packet0;
+  packet0.wireDecode(wire);
+
+  // Construct Prefix Announcement
+  PrefixAnnouncement pa;
+  pa.setAnnouncedName("/net/example");
+  pa.setExpiration(5_min);
+  pa.setValidityPeriod(security::ValidityPeriod(time::fromIsoString("20181030T000000"),
+                                                time::fromIsoString("20181124T235959")));
+  pa.toData(m_keyChain, signingWithSha256(), 1);
+  PrefixAnnouncementHeader pah0(pa);
+  BOOST_CHECK_NO_THROW(packet0.add<PrefixAnnouncementField>(pah0));
+  Block encoded;
+  BOOST_CHECK_NO_THROW(encoded = packet0.wireEncode());
+
+  // check decoding
+  Packet packet1;
+  BOOST_CHECK_NO_THROW(packet1.wireDecode(encoded));
+  BOOST_CHECK_EQUAL(true, packet1.has<PrefixAnnouncementField>());
+  PrefixAnnouncementHeader pah1;
+  BOOST_CHECK_NO_THROW(pah1 = packet1.get<PrefixAnnouncementField>());
+  BOOST_CHECK_EQUAL(pah1.getPrefixAnn()->getAnnouncedName(), "/net/example");
+}
+
 BOOST_AUTO_TEST_SUITE_END() // TestPacket
 BOOST_AUTO_TEST_SUITE_END() // Lp
 
diff --git a/tests/unit-tests/lp/prefix-announcement-header.t.cpp b/tests/unit-tests/lp/prefix-announcement-header.t.cpp
new file mode 100644
index 0000000..38a75f3
--- /dev/null
+++ b/tests/unit-tests/lp/prefix-announcement-header.t.cpp
@@ -0,0 +1,70 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "lp/prefix-announcement-header.hpp"
+#include "lp/tlv.hpp"
+#include "security/signature-sha256-with-rsa.hpp"
+
+#include "boost-test.hpp"
+#include "identity-management-fixture.hpp"
+
+namespace ndn {
+namespace lp {
+namespace tests {
+
+BOOST_AUTO_TEST_SUITE(Lp)
+BOOST_FIXTURE_TEST_SUITE(TestPrefixAnnouncementHeader, ndn::tests::IdentityManagementFixture)
+
+BOOST_AUTO_TEST_CASE(EncodeDecode)
+{
+  EncodingEstimator estimator;
+  PrefixAnnouncementHeader header;
+  BOOST_CHECK_THROW(header.wireEncode(estimator), PrefixAnnouncementHeader::Error);
+  BOOST_CHECK_THROW(PrefixAnnouncementHeader{PrefixAnnouncement()}, PrefixAnnouncementHeader::Error);
+
+  PrefixAnnouncement pa;
+  pa.setAnnouncedName("/net/example");
+  pa.setExpiration(1_h);
+  const Data& data = pa.toData(m_keyChain, signingWithSha256(), 1);
+  Block encodedData = data.wireEncode();
+
+  Block expectedBlock(tlv::PrefixAnnouncement);
+  expectedBlock.push_back(encodedData);
+  expectedBlock.encode();
+
+  PrefixAnnouncementHeader pah0(pa);
+  size_t estimatedSize = pah0.wireEncode(estimator);
+  EncodingBuffer buffer(estimatedSize, 0);
+  pah0.wireEncode(buffer);
+  Block wire = buffer.block();
+  BOOST_CHECK_EQUAL(expectedBlock, wire);
+
+  PrefixAnnouncementHeader pah1;
+  pah1.wireDecode(wire);
+  BOOST_CHECK_EQUAL(*pah0.getPrefixAnn(), *pah1.getPrefixAnn());
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestPrefixAnnouncementHeader
+BOOST_AUTO_TEST_SUITE_END() // Lp
+
+} // namespace tests
+} // namespace lp
+} // namespace ndn
diff --git a/tests/unit-tests/lp/prefix-announcement.t.cpp b/tests/unit-tests/lp/prefix-announcement.t.cpp
deleted file mode 100644
index 5fdde2c..0000000
--- a/tests/unit-tests/lp/prefix-announcement.t.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2013-2018 Regents of the University of California.
- *
- * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
- *
- * ndn-cxx library is free software: you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free Software
- * Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- *
- * You should have received copies of the GNU General Public License and GNU Lesser
- * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- * @author Teng Liang <philoliang@email.arizona.edu>
- */
-
-#include "lp/prefix-announcement.hpp"
-#include "security/signature-sha256-with-rsa.hpp"
-
-#include "boost-test.hpp"
-#include "make-interest-data.hpp"
-
-namespace ndn {
-namespace lp {
-namespace tests {
-
-using namespace ndn::tests;
-
-BOOST_AUTO_TEST_SUITE(Lp)
-BOOST_AUTO_TEST_SUITE(TestPrefixAnnouncement)
-
-BOOST_AUTO_TEST_CASE(SetData)
-{
-  Name name1("/ndn/pa");
-  Name name2("/self-learning/ndn/pa");
-  Name name3("/self-learning/ndn/pa");
-  name3.appendVersion();
-
-  PrefixAnnouncement pa;
-  BOOST_CHECK_THROW(pa.setData(nullptr), PrefixAnnouncement::Error);
-  BOOST_CHECK_THROW(pa.setData(makeData(name1)), PrefixAnnouncement::Error);
-  BOOST_CHECK_THROW(pa.setData(makeData(name2)), PrefixAnnouncement::Error);
-  BOOST_CHECK_NO_THROW(pa.setData(makeData(name3)));
-  BOOST_CHECK_EQUAL(pa.getAnnouncedName(), "/ndn/pa");
-
-  shared_ptr<Data> data1 = makeData(name3);
-  shared_ptr<Data> data2 = makeData(name3);
-  static const uint8_t someData[] = "someData";
-  data1->setContent(someData, sizeof(someData));
-  data2->setFreshnessPeriod(10_s);
-  BOOST_CHECK_THROW(pa.setData(data1), PrefixAnnouncement::Error);
-  BOOST_CHECK_THROW(pa.setData(data2), PrefixAnnouncement::Error);
-}
-
-BOOST_AUTO_TEST_CASE(GetAnnouncedName)
-{
-  PrefixAnnouncement pa1;
-  BOOST_CHECK_THROW(pa1.getAnnouncedName(), PrefixAnnouncement::Error);
-
-  Name name("/self-learning/edu/ua/news");
-  name.appendVersion();
-
-  PrefixAnnouncement pa2(makeData(name));
-
-  BOOST_CHECK_EQUAL(pa2.getAnnouncedName(), "/edu/ua/news");
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestPrefixAnnouncement
-BOOST_AUTO_TEST_SUITE_END() // Lp
-
-} // namespace tests
-} // namespace lp
-} // namespace ndn
