 
 (deftest get-certificate-revocation-list-test
   (testing "`get-certificate-revocation-list` returns a valid CRL file."
-    (let [crl    (-> cacrl
-                     get-certificate-revocation-list
-                     StringReader.
-                     utils/pem->crl)
-          issuer (-> crl .getIssuerX500Principal .getName)]
-      (is (= "CN=Puppet CA: localhost" issuer)))))
+    (let [crl (-> (get-certificate-revocation-list cacrl)
+                  StringReader.
+                  utils/pem->crl)]
+      (assert-issuer crl "CN=Puppet CA: localhost"))))
 
 (let [ssldir          (ks/temp-dir)
       cadir           (str ssldir "/ca")

(def cacrl (str cadir "/ca_crl.pem"))
(def csrdir (str cadir "/requests"))
(def signeddir (str cadir "/signed"))

(deftest get-certificate-test
  (testing "returns CA certificate when subject is 'ca'"


        (testing "requests are autosigned and saved to disk"
          (is (fs/exists? expected-cert-path))
          (doto (utils/pem->cert expected-cert-path)
            (assert-subject "CN=test-agent")
            (assert-issuer "CN=test ca")))

        (testing "cert expiration is correct based on Puppet's ca_ttl setting"
          (let [duration (Period. now expiration)]
