diff --git a/tests/tools/nfdc/face-module.t.cpp b/tests/tools/nfdc/face-module.t.cpp
index 8d33ee8..bce68b7 100644
--- a/tests/tools/nfdc/face-module.t.cpp
+++ b/tests/tools/nfdc/face-module.t.cpp
@@ -227,15 +227,15 @@
 {
 protected:
   void
-  respond409(FacePersistency persistency)
+  respond409(const Interest& interest, FacePersistency persistency)
   {
-    MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/create");
+    MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/faces/create");
     ControlParameters body;
     body.setFaceId(1172)
         .setUri("udp4://100.77.30.65:6363")
         .setFacePersistency(persistency)
         .setFlags(0);
-    this->failCommand(409, "conflict-409", body);
+    this->failCommand(interest, 409, "conflict-409", body);
   }
 };
 
@@ -244,7 +244,7 @@
 BOOST_AUTO_TEST_CASE(Creating)
 {
   this->processInterest = [this] (const Interest& interest) {
-    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/create");
+    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/faces/create");
     BOOST_REQUIRE(req.hasUri());
     BOOST_CHECK_EQUAL(req.getUri(), "udp4://159.242.33.78:6363");
     BOOST_REQUIRE(req.hasFacePersistency());
@@ -253,7 +253,7 @@
     ControlParameters resp;
     resp.setFaceId(2130)
         .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
-    this->succeedCommand(resp);
+    this->succeedCommand(interest, resp);
   };
 
   this->execute("face create udp://159.242.33.78");
@@ -266,12 +266,12 @@
 {
   bool hasUpdateCommand = false;
   this->processInterest = [this, &hasUpdateCommand] (const Interest& interest) {
-    if (this->getCommand("/localhost/nfd/faces/create")) {
-      this->respond409(FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
+    if (parseCommand(interest, "/localhost/nfd/faces/create")) {
+      this->respond409(interest, FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
       return;
     }
 
-    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/update");
+    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/faces/update");
     hasUpdateCommand = true;
     BOOST_REQUIRE(req.hasFaceId());
     BOOST_CHECK_EQUAL(req.getFaceId(), 1172);
@@ -283,7 +283,7 @@
     resp.setFaceId(1172)
         .setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT)
         .setFlags(0);
-    this->succeedCommand(resp);
+    this->succeedCommand(interest, resp);
   };
 
   this->execute("face create udp://100.77.30.65");
@@ -296,7 +296,7 @@
 BOOST_AUTO_TEST_CASE(NotDowngradingPersistency)
 {
   this->processInterest = [this] (const Interest& interest) {
-    this->respond409(FacePersistency::FACE_PERSISTENCY_PERMANENT);
+    this->respond409(interest, FacePersistency::FACE_PERSISTENCY_PERMANENT);
     // no command other than faces/create is expected
   };
 
@@ -309,7 +309,7 @@
 BOOST_AUTO_TEST_CASE(SamePersistency)
 {
   this->processInterest = [this] (const Interest& interest) {
-    this->respond409(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
+    this->respond409(interest, FacePersistency::FACE_PERSISTENCY_PERSISTENT);
     // no command other than faces/create is expected
   };
 
@@ -336,7 +336,7 @@
 
   this->processInterest = [this] (const Interest& interest) {
     // conflict with udp4://100.77.30.65:6363
-    this->respond409(FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
+    this->respond409(interest, FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
   };
 
   this->execute("face create udp://20.53.73.45");
@@ -348,12 +348,12 @@
 BOOST_AUTO_TEST_CASE(ErrorUpdate)
 {
   this->processInterest = [this] (const Interest& interest) {
-    if (this->getCommand("/localhost/nfd/faces/create")) {
-      this->respond409(FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
+    if (parseCommand(interest, "/localhost/nfd/faces/create")) {
+      this->respond409(interest, FacePersistency::FACE_PERSISTENCY_ON_DEMAND);
       return;
     }
 
-    MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/update");
+    MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/faces/update");
     // no response to faces/update
   };
 
@@ -374,13 +374,13 @@
       return;
     }
 
-    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy");
+    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/faces/destroy");
     BOOST_REQUIRE(req.hasFaceId());
     BOOST_CHECK_EQUAL(req.getFaceId(), 10156);
 
     ControlParameters resp;
     resp.setFaceId(10156);
-    this->succeedCommand(resp);
+    this->succeedCommand(interest, resp);
   };
 
   this->execute("face destroy 10156");
@@ -397,13 +397,13 @@
       return;
     }
 
-    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy");
+    ControlParameters req = MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/faces/destroy");
     BOOST_REQUIRE(req.hasFaceId());
     BOOST_CHECK_EQUAL(req.getFaceId(), 2249);
 
     ControlParameters resp;
     resp.setFaceId(2249);
-    this->succeedCommand(resp);
+    this->succeedCommand(interest, resp);
   };
 
   this->execute("face destroy tcp://32.121.182.82");
@@ -466,7 +466,7 @@
       return;
     }
 
-    MOCK_NFD_MGMT_REQUIRE_LAST_COMMAND_IS("/localhost/nfd/faces/destroy");
+    MOCK_NFD_MGMT_REQUIRE_COMMAND_IS("/localhost/nfd/faces/destroy");
     // no response to command
   };
 
