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));
