Update the NDNCERT library to version NDNCERT v2
spec:[https://github.com/named-data/ndncert/wiki/NDNCERT-Protocol-new]
Change-Id: Ia480a8e70c4b38ca170dfe2fcf50d1265ab65f46
diff --git a/tests/unit-tests/ca-sqlite.t.cpp b/tests/unit-tests/ca-sqlite.t.cpp
index be4b54d..e1c8495 100644
--- a/tests/unit-tests/ca-sqlite.t.cpp
+++ b/tests/unit-tests/ca-sqlite.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2017, Regents of the University of California.
+ * Copyright (c) 2017-2019, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -18,8 +18,8 @@
* See AUTHORS.md for complete list of ndncert authors and contributors.
*/
-#include "database-fixture.hpp"
#include "ca-detail/ca-sqlite.hpp"
+#include "database-fixture.hpp"
namespace ndn {
namespace ndncert {
@@ -81,31 +81,30 @@
auto cert1 = key1.getDefaultCertificate();
// add operation
- CertificateRequest request1(Name("/ndn/site1"), "123", cert1);
+ CertificateRequest request1(Name("/ndn/site1"), "123", STATUS_BEFORE_CHALLENGE, cert1);
BOOST_CHECK_NO_THROW(storage.addRequest(request1));
// get operation
auto result = storage.getRequest("123");
- BOOST_CHECK_EQUAL(request1.getCert(), result.getCert());
- BOOST_CHECK_EQUAL(request1.getStatus(), result.getStatus());
- BOOST_CHECK_EQUAL(request1.getCaName(), result.getCaName());
-
- JsonSection json;
- json.put("code", "1234");
+ BOOST_CHECK_EQUAL(request1.m_cert, result.m_cert);
+ BOOST_CHECK_EQUAL(request1.m_status, result.m_status);
+ BOOST_CHECK_EQUAL(request1.m_caName, result.m_caName);
// update operation
- CertificateRequest request2(Name("/ndn/site1"), "123", "need-verify", "EMAIL",
- CaSqlite::convertJson2String(json), cert1);
+ JsonSection json;
+ json.put("test", "4567");
+ CertificateRequest request2(Name("/ndn/site1"), "123", STATUS_CHALLENGE, CHALLENGE_STATUS_SUCCESS,
+ "Email", time::toIsoString(time::system_clock::now()), 3600, 3, json, cert1);
storage.updateRequest(request2);
result = storage.getRequest("123");
- BOOST_CHECK_EQUAL(request2.getCert(), result.getCert());
- BOOST_CHECK_EQUAL(request2.getStatus(), result.getStatus());
- BOOST_CHECK_EQUAL(request2.getCaName(), result.getCaName());
+ BOOST_CHECK_EQUAL(request2.m_cert, result.m_cert);
+ BOOST_CHECK_EQUAL(request2.m_status, result.m_status);
+ BOOST_CHECK_EQUAL(request2.m_caName, result.m_caName);
auto identity2 = addIdentity(Name("/ndn/site2"));
auto key2 = identity2.getDefaultKey();
auto cert2 = key2.getDefaultCertificate();
- CertificateRequest request3(Name("/ndn/site2"), "456", cert2);
+ CertificateRequest request3(Name("/ndn/site2"), "456", STATUS_BEFORE_CHALLENGE, cert2);
storage.addRequest(request3);
// list operation