security: Abstract certificate fetching from v2::Validator
Change-Id: Ia98d11ac67b0095f632818ac37a19a1e5a7656a8
Refs: #3921
diff --git a/tests/unit-tests/security/v2/validator-fixture.hpp b/tests/unit-tests/security/v2/validator-fixture.hpp
index 8fac880..aa512ea 100644
--- a/tests/unit-tests/security/v2/validator-fixture.hpp
+++ b/tests/unit-tests/security/v2/validator-fixture.hpp
@@ -23,6 +23,7 @@
#define NDN_TESTS_SECURITY_V2_VALIDATOR_FIXTURE_HPP
#include "security/v2/validator.hpp"
+#include "security/v2/certificate-fetcher-from-network.hpp"
#include "util/dummy-client-face.hpp"
#include "../../identity-management-time-fixture.hpp"
@@ -34,13 +35,13 @@
namespace v2 {
namespace tests {
-template<class ValidationPolicy>
+template<class ValidationPolicy, class CertificateFetcher = CertificateFetcherFromNetwork>
class ValidatorFixture : public ndn::tests::IdentityManagementTimeFixture
{
public:
ValidatorFixture()
: face(io, {true, true})
- , validator(make_unique<ValidationPolicy>(), &face)
+ , validator(make_unique<ValidationPolicy>(), make_unique<CertificateFetcher>(face))
, cache(time::days(100))
{
processInterest = [this] (const Interest& interest) {
@@ -96,8 +97,8 @@
CertificateCache cache;
};
-template<class ValidationPolicy>
-class HierarchicalValidatorFixture : public ValidatorFixture<ValidationPolicy>
+template<class ValidationPolicy, class CertificateFetcher = CertificateFetcherFromNetwork>
+class HierarchicalValidatorFixture : public ValidatorFixture<ValidationPolicy, CertificateFetcher>
{
public:
HierarchicalValidatorFixture()