management: Controller validates StatusDataset response
refs #3653
Change-Id: Id54026d7277fecf52b6443bf42d01b5e6d7e35a3
diff --git a/tests/unit-tests/management/nfd-controller-fixture.hpp b/tests/unit-tests/management/nfd-controller-fixture.hpp
index 9894468..492cbc2 100644
--- a/tests/unit-tests/management/nfd-controller-fixture.hpp
+++ b/tests/unit-tests/management/nfd-controller-fixture.hpp
@@ -22,6 +22,9 @@
#ifndef NDN_TESTS_MANAGEMENT_NFD_CONTROLLER_FIXTURE_HPP
#define NDN_TESTS_MANAGEMENT_NFD_CONTROLLER_FIXTURE_HPP
+#include "management/nfd-controller.hpp"
+#include "../../dummy-validator.hpp"
+
#include "boost-test.hpp"
#include "util/dummy-client-face.hpp"
#include "../identity-management-time-fixture.hpp"
@@ -37,7 +40,7 @@
protected:
ControllerFixture()
: face(io, m_keyChain)
- , controller(face, m_keyChain)
+ , controller(face, m_keyChain, m_validator)
, failCallback(bind(&ControllerFixture::fail, this, _1, _2))
{
Name identityName("/localhost/ControllerFixture");
@@ -49,6 +52,17 @@
}
}
+ /** \brief controls whether Controller's validator should accept or reject validation requests
+ *
+ * Initially, the validator accepts all requests.
+ * Setting \p false causes validator to reject all requests.
+ */
+ void
+ setValidationResult(bool shouldAccept)
+ {
+ m_validator.setResult(shouldAccept);
+ }
+
private:
void
fail(uint32_t code, const std::string& reason)
@@ -61,6 +75,9 @@
Controller controller;
Controller::CommandFailCallback failCallback;
std::vector<uint32_t> failCodes;
+
+private:
+ DummyValidator m_validator;
};
} // namespace tests