diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index a75bf30..90e4b1e 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -87,7 +87,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
 
-  strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 1);
 
@@ -98,7 +98,7 @@
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face2, *interest);
 
-  strategy.afterReceiveInterest(FaceEndpoint(*face2, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2, 0), pitEntry);
   // Since the interest is the same as the one sent out earlier, the PIT entry should not be
   // rejected, as any data coming back must be able to satisfy the original interest from face 1
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
@@ -164,7 +164,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face3, *interest);
 
-  strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_TEST(didSendInterestTo(*face1));
@@ -180,7 +180,7 @@
   std::function<void()> periodicalRetxFrom4; // let periodicalRetxFrom4 lambda capture itself
   periodicalRetxFrom4 = [&] {
     pitEntry->insertOrUpdateInRecord(*face3, *interest);
-    strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+    strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
 
     size_t nSent = strategy.sendInterestHistory.size();
     if (nSent > nSentLast) {
@@ -208,7 +208,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
 
-  strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 0);
 }
@@ -228,7 +228,7 @@
   auto interest = makeInterest("/t8ZiSOi3");
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
-  strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
 
   // forwarded to faces 2 and 3
   BOOST_TEST(strategy.sendInterestHistory.size() == 2);
@@ -243,7 +243,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face2, *interest);
-  strategy.afterReceiveInterest(FaceEndpoint(*face2, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face2, 0), pitEntry);
 
   // forwarded only to face 1, suppressed on face 3
   BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -257,7 +257,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face3, *interest);
-  strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
 
   // suppressed on face 1, forwarded on face 2 (and suppression window doubles)
   BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -271,7 +271,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face3, *interest);
-  strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face3, 0), pitEntry);
 
   // forwarded only to face 1, suppressed on face 2
   BOOST_TEST(strategy.sendInterestHistory.size() == 1);
@@ -285,7 +285,7 @@
   interest->refreshNonce();
   pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
-  strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
 
   // forwarded to faces 2 and 3
   BOOST_TEST(strategy.sendInterestHistory.size() == 2);
@@ -304,7 +304,7 @@
   auto pitEntry = pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*face1, *interest);
 
-  strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest, pitEntry);
+  strategy.afterReceiveInterest(*interest, FaceEndpoint(*face1, 0), pitEntry);
   BOOST_CHECK_EQUAL(strategy.rejectPendingInterestHistory.size(), 0);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory.size(), 1);
 
@@ -492,12 +492,12 @@
   auto interest = makeInterest("ndn:/localhop/H0D6i5fc");
   auto pitEntry = this->pit.insert(*interest).first;
   pitEntry->insertOrUpdateInRecord(*this->inFace1, *interest);
-  this->strategy.afterReceiveInterest(FaceEndpoint(*this->inFace1, 0), *interest, pitEntry);
+  this->strategy.afterReceiveInterest(*interest, FaceEndpoint(*this->inFace1, 0), pitEntry);
 
   if (this->inFace2 != nullptr) {
     auto interest2 = makeInterest("ndn:/localhop/H0D6i5fc");
     pitEntry->insertOrUpdateInRecord(*this->inFace2, *interest2);
-    this->strategy.afterReceiveInterest(FaceEndpoint(*this->inFace2, 0), *interest2, pitEntry);
+    this->strategy.afterReceiveInterest(*interest2, FaceEndpoint(*this->inFace2, 0), pitEntry);
   }
 
   this->strategy.sendInterestHistory.clear();
