update: migrate to new Dispatcher API for control commands
Change-Id: I87481be651c93050e23cf7429520023f29494acd
diff --git a/tests/update/test-nfd-rib-command-processor.cpp b/tests/update/test-nfd-rib-command-processor.cpp
index 371610f..3afef2c 100644
--- a/tests/update/test-nfd-rib-command-processor.cpp
+++ b/tests/update/test-nfd-rib-command-processor.cpp
@@ -27,7 +27,6 @@
#include "tests/test-common.hpp"
#include <boost/lexical_cast.hpp>
-#include <boost/mp11/list.hpp>
namespace nlsr::tests {
@@ -53,7 +52,7 @@
void
sendCommand(ndn::Name prefix, const ndn::nfd::ControlParameters& parameters)
{
- ndn::Interest interest(prefix.append(ndn::tlv::GenericNameComponent, parameters.wireEncode()));
+ ndn::Interest interest(prefix.append(parameters.wireEncode()));
face.receive(interest);
this->advanceClocks(ndn::time::milliseconds(10), 10);
}
@@ -76,13 +75,9 @@
sendInterestForPublishedData();
const ndn::Name& lsaPrefix = conf.getLsaPrefix();
-
- const auto& it = std::find_if(face.sentData.begin(), face.sentData.end(),
- [&] (const ndn::Data& data) {
- return lsaPrefix.isPrefixOf(data.getName());
- });
-
- return (it != face.sentData.end());
+ auto it = std::find_if(face.sentData.begin(), face.sentData.end(),
+ [&] (const auto& data) { return lsaPrefix.isPrefixOf(data.getName()); });
+ return it != face.sentData.end();
}
public:
@@ -96,29 +91,8 @@
uint64_t nameLsaSeqNoBeforeInterest;
};
-using Commands = boost::mp11::mp_list<
- ndn::nfd::RibRegisterCommand,
- ndn::nfd::RibUnregisterCommand
->;
-
BOOST_FIXTURE_TEST_SUITE(TestNfdRibCommandProcessor, NfdRibCommandProcessorFixture)
-BOOST_AUTO_TEST_CASE_TEMPLATE(ValidateParametersSuccess, NfdRibCommand, Commands)
-{
- ndn::nfd::ControlParameters parameters;
- parameters.setName("/test/prefixA");
-
- BOOST_CHECK(processor.validateParameters<NfdRibCommand>(parameters));
-}
-
-BOOST_AUTO_TEST_CASE_TEMPLATE(ValidateParametersFailure, NfdRibCommand, Commands)
-{
- ndn::nfd::ControlParameters parameters;
- parameters.setName("/test/prefixA").setMtu(500);
-
- BOOST_CHECK_THROW(processor.validateParameters<NfdRibCommand>(parameters), std::invalid_argument);
-}
-
BOOST_AUTO_TEST_CASE(OnReceiveInterestRegisterCommand)
{
ndn::Name name("/localhost/nlsr/rib/register");