tests: set CanBePrefix in daemon tests

This commit also updates makeInterest and makeNack functions
so that their APIs are compatible with ndn-cxx test suite.

refs #4581

Change-Id: I0c81740416c26a03450dc3a12c89944b72ce5901
diff --git a/tests/test-common.cpp b/tests/test-common.cpp
index 534d961..9bc824a 100644
--- a/tests/test-common.cpp
+++ b/tests/test-common.cpp
@@ -31,11 +31,16 @@
 namespace tests {
 
 shared_ptr<Interest>
-makeInterest(const Name& name, uint32_t nonce)
+makeInterest(const Name& name, bool canBePrefix, optional<time::milliseconds> lifetime,
+             optional<uint32_t> nonce)
 {
   auto interest = make_shared<Interest>(name);
-  if (nonce != 0) {
-    interest->setNonce(nonce);
+  interest->setCanBePrefix(canBePrefix);
+  if (lifetime) {
+    interest->setInterestLifetime(*lifetime);
+  }
+  if (nonce) {
+    interest->setNonce(*nonce);
   }
   return interest;
 }
@@ -66,14 +71,6 @@
   return nack;
 }
 
-lp::Nack
-makeNack(const Name& name, uint32_t nonce, lp::NackReason reason)
-{
-  Interest interest(name);
-  interest.setNonce(nonce);
-  return makeNack(std::move(interest), reason);
-}
-
 ndn::PrefixAnnouncement
 makePrefixAnn(const Name& announcedName, time::milliseconds expiration,
               optional<ndn::security::ValidityPeriod> validity)