public void testPrintCertificateInfo() { String expectedCertificateInfo = "Certificate name:\n" + " /ndn/site1/KEY/ksk-1416425377094/0123/%FD%00%00%01I%C9%8B\n" + "Validity:\n" + " NotBefore: 20150814T223739\n" + " NotAfter: 20150818T223738\n" + "Public key bits:\n" + "MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCeBj5HhbI0N6qFR6wDJIO1nKgF\n" + "OiQe64kBu+mbssMirGjj8GwCzmimxNCnBpCcqhsIHYtDmjNnRG0hoxuImpdeWcQV\n" + "C9ksvVEHYYKtwbjXv5vPfSTCY/OXF+v+YiW6W02Kwnq9Q4qPuPLxxWow01CMyJrf\n" + "7+0153pi6nZ8uwgmxwIBEQ==\n" + "Signature Information:\n" + " Signature Type: SignatureSha256WithRsa\n" + " Key Locator: Name=/ndn/site1/KEY/ksk-2516425377094\n"; CertificateV2 certificate = new CertificateV2(); certificate.wireDecode(new Blob(CERT, false)); StringBuilder actual = new StringBuilder(); certificate.printCertificate(actual); Assert.AssertEquals(expectedCertificateInfo, actual.toString()); }