address comments

Change-Id: Id12b605453752cf947c81b6cdda582d93a4d2bcf
diff --git a/tests/unit-tests/challenge-email.t.cpp b/tests/unit-tests/challenge-email.t.cpp
index 429e532..8ee9be9 100644
--- a/tests/unit-tests/challenge-email.t.cpp
+++ b/tests/unit-tests/challenge-email.t.cpp
@@ -45,9 +45,12 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  RequestId requestId = {{1,2,3,4,5,6,7,8}};
-  std::array<uint8_t, 16> aesKey;
-  ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, std::move(aesKey));
+  RequestId requestId = {{101}};
+  ca::RequestState request;
+  request.caPrefix = Name("/ndn/site1");
+  request.requestId = requestId;
+  request.requestType = RequestType::NEW;
+  request.cert = cert;
 
   Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
   paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
@@ -96,9 +99,12 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  RequestId requestId = {{1,2,3,4,5,6,7,8}};
-  std::array<uint8_t, 16> aesKey;
-  ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, std::move(aesKey));
+  RequestId requestId = {{101}};
+  ca::RequestState request;
+  request.caPrefix = Name("/ndn/site1");
+  request.requestId = requestId;
+  request.requestType = RequestType::NEW;
+  request.cert = cert;
 
   Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
   paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
@@ -117,13 +123,18 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  JsonSection json;
-  json.put(ChallengeEmail::PARAMETER_KEY_CODE, "4567");
-  RequestId requestId = {{1,2,3,4,5,6,7,8}};
-  std::array<uint8_t, 16> aesKey;
-  ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
-                           "email", ChallengeEmail::NEED_CODE, time::system_clock::now(),
-                           3, time::seconds(3600), std::move(json), std::move(aesKey), 0);
+  JsonSection secret;
+  secret.put(ChallengeEmail::PARAMETER_KEY_CODE, "4567");
+  RequestId requestId = {{101}};
+  ca::RequestState request;
+  request.caPrefix = Name("/ndn/site1");
+  request.requestId = requestId;
+  request.requestType = RequestType::NEW;
+  request.status = Status::CHALLENGE;
+  request.cert = cert;
+  request.challengeType = "email";
+  request.challengeState = ca::ChallengeState(ChallengeEmail::NEED_CODE, time::system_clock::now(),
+                                              3, time::seconds(3600), std::move(secret));
 
   Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
   paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_CODE));
@@ -141,13 +152,18 @@
   auto identity = addIdentity(Name("/ndn/site1"));
   auto key = identity.getDefaultKey();
   auto cert = key.getDefaultCertificate();
-  JsonSection json;
-  json.put(ChallengeEmail::PARAMETER_KEY_CODE, "4567");
-  RequestId requestId = {{1,2,3,4,5,6,7,8}};
-  std::array<uint8_t, 16> aesKey;
-  ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
-                           "email", ChallengeEmail::NEED_CODE, time::system_clock::now(),
-                           3, time::seconds(3600), std::move(json), std::move(aesKey), 0);
+  JsonSection secret;
+  secret.put(ChallengeEmail::PARAMETER_KEY_CODE, "4567");
+  RequestId requestId = {{101}};
+  ca::RequestState request;
+  request.caPrefix = Name("/ndn/site1");
+  request.requestId = requestId;
+  request.requestType = RequestType::NEW;
+  request.status = Status::CHALLENGE;
+  request.cert = cert;
+  request.challengeType = "email";
+  request.challengeState = ca::ChallengeState(ChallengeEmail::NEED_CODE, time::system_clock::now(),
+                                              3, time::seconds(3600), std::move(secret));
 
   Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
   paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_CODE));